diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 575cb59..d8fe526 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -19,28 +19,20 @@ jobs: fetch-depth: 2 - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 + uses: crazy-max/ghaction-docker-meta@v4 with: images: ghcr.io/${{ github.repository_owner }}/stargate-consul-example - - name: Set branch name - id: set-branch-name - run: | - if [[ -z "${GITHUB_HEAD_REF##*/}" ]]; then - echo "::set-output name=BRANCH_NAME::${GITHUB_REF##*/}" - else - echo "::set-output name=BRANCH_NAME::${GITHUB_HEAD_REF##*/}" - fi - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to Container Registry if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} - name: Docker build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: ./ file: ./docker/Dockerfile diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000..2fd90a3 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,14 @@ +name: Integration Tests + +on: [push,pull_request,workflow_dispatch] + +jobs: + integration-tests: + runs-on: ubuntu-latest + name: Integration Tests + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Run tests using Docker + run: ./compose-test.sh diff --git a/.github/workflows/loading-groups.yml b/.github/workflows/loading-groups.yml index 0ac14b9..9d58340 100644 --- a/.github/workflows/loading-groups.yml +++ b/.github/workflows/loading-groups.yml @@ -8,11 +8,11 @@ jobs: strategy: fail-fast: false matrix: - smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] + smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] load-spec: [ deployment, examples, tools, development] name: ${{ matrix.smalltalk }} + ${{ matrix.load-spec }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: ${{ matrix.smalltalk }} diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index f59b059..fbb50fa 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -5,9 +5,9 @@ jobs: name: runner / markdownlint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: markdownlint - uses: reviewdog/action-markdownlint@v0.1 + uses: reviewdog/action-markdownlint@v0 with: github_token: ${{ secrets.GITHUB_TOKEN }} fail_on_error: true diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 8b51488..6fe7559 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -6,7 +6,7 @@ jobs: shellcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Run Shellcheck uses: reviewdog/action-shellcheck@v1 with: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index cf7dd3f..6383768 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -7,13 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] + smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] name: ${{ matrix.smalltalk }} steps: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 2 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: ${{ matrix.smalltalk }} @@ -22,11 +20,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 15 - - name: Run tests using Docker - if: matrix.smalltalk == 'Pharo64-10' - run: ./compose-test.sh - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: - name: ${{matrix.os}}-${{matrix.smalltalk}} + name: Unit-Tests-${{matrix.smalltalk}} token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index eacbb35..8d77cab 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ plugin to interact with the [Consul](https://www.consul.io) HTTP API. [![Unit Tests](https://github.com/ba-st/Stargate-Consul/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ba-st/Stargate-Consul/actions/workflows/unit-tests.yml) [![Coverage Status](https://codecov.io/github/ba-st/Stargate-Consul/coverage.svg?branch=release-candidate)](https://codecov.io/gh/ba-st/Stargate-Consul/branch/release-candidate) [![Baseline Groups](https://github.com/ba-st/Stargate-Consul/actions/workflows/loading-groups.yml/badge.svg)](https://github.com/ba-st/Stargate-Consul/actions/workflows/loading-groups.yml) +[![Integration Tests](https://github.com/ba-st/Stargate-Consul/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/ba-st/Stargate-Consul/actions/workflows/integration-tests.yml) [![Markdown Lint](https://github.com/ba-st/Stargate-Consul/actions/workflows/markdown-lint.yml/badge.svg)](https://github.com/ba-st/Stargate-Consul/actions/workflows/markdown-lint.yml) [![Shellcheck](https://github.com/ba-st/Stargate-Consul/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/ba-st/Stargate-Consul/actions/workflows/shellcheck.yml) @@ -15,6 +16,7 @@ plugin to interact with the [Consul](https://www.consul.io) HTTP API. [![Pharo 8.0](https://img.shields.io/badge/Pharo-8.0-informational)](https://pharo.org) [![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://pharo.org) [![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://pharo.org) +[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org) Quick links @@ -32,7 +34,7 @@ API to register and deregister the configured services when the API starts/stops ## Installation -To load the project in a Pharo image follow this [instructions](docs/how-to/how-to-load-in-pharo.md). +To load the project in a Pharo image follow these [instructions](docs/how-to/how-to-load-in-pharo.md). ## Contributing diff --git a/compose-test.sh b/compose-test.sh index 198d4d6..a2d377f 100755 --- a/compose-test.sh +++ b/compose-test.sh @@ -3,12 +3,12 @@ set -e echo "Building API" -docker-compose -f api-tests/docker-compose.yml build api +docker compose -f api-tests/docker-compose.yml build api echo "Starting Consul Agent" -docker-compose -f api-tests/docker-compose.yml up -d consul-agent +docker compose -f api-tests/docker-compose.yml up -d consul-agent sleep 1 echo "Starting API" -docker-compose -f api-tests/docker-compose.yml up -d api +docker compose -f api-tests/docker-compose.yml up -d api sleep 10 echo "Testing API" curl --fail http://localhost:8080/echo/hello @@ -18,7 +18,7 @@ HEALTH_STATUS=$(curl -s http://localhost:8500/v1/health/checks/echo | jq '.[0].S echo "$HEALTH_STATUS" if [ "$HEALTH_STATUS" != '"passing"' ]; then echo "Error: Echo service is unhealthy" >&2 - docker-compose -f api-tests/docker-compose.yml down + docker compose -f api-tests/docker-compose.yml down exit 1 fi -docker-compose -f api-tests/docker-compose.yml down +docker compose -f api-tests/docker-compose.yml down diff --git a/docker/Dockerfile b/docker/Dockerfile index a5eda29..bee76a1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,9 @@ # Stage 1: Load the project -FROM ghcr.io/ba-st/pharo-loader:v10.0.0 AS loader +FROM ghcr.io/ba-st/pharo-loader:v11.0.0 AS loader -COPY ./source ./source -COPY ./.git ./.git -RUN pharo metacello install gitlocal://./source \ +COPY --chown=pharo:users ./source ./source +COPY --chown=pharo:users ./.git ./.git +RUN pharo metacello install gitlocal://. \ BaselineOfStargateConsul --groups=Examples # Stage 2: Copy the resulting Pharo.image @@ -11,11 +11,6 @@ FROM ghcr.io/ba-st/launchpad:v4 USER root -RUN apt-get update \ - && apt-get --assume-yes --no-install-recommends install curl \ - && apt-get clean \ - && rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/* - COPY --from=loader /opt/pharo/pharo-local/iceberg/ba-st/Stargate/docker/health-check.sh ./ COPY --from=loader /opt/pharo/Pharo.image ./ COPY --from=loader /opt/pharo/Pharo.changes ./