From b37656907f928aad51fa8d67a7595164753482c5 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 18:45:22 -0300 Subject: [PATCH 1/5] Add Pharo 11 --- .github/workflows/loading-groups.yml | 4 ++-- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/unit-tests.yml | 8 ++++---- README.md | 1 + api-tests/Dockerfile | 20 ++++++++----------- api-tests/docker-compose.yml | 5 ++--- api-tests/load-project.st | 11 ---------- api-tests/start.sh | 6 ------ compose-test.sh | 6 +++++- .../BaselineOfSuperluminal.class.st | 10 +++++----- 10 files changed, 28 insertions(+), 45 deletions(-) delete mode 100644 api-tests/load-project.st delete mode 100644 api-tests/start.sh diff --git a/.github/workflows/loading-groups.yml b/.github/workflows/loading-groups.yml index 065b46f..dce2e6d 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: [ core, api-client, service-discovery, deployment, examples, dependent-sunit-extensions] 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..b21e7e0 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v2 - 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/unit-tests.yml b/.github/workflows/unit-tests.yml index ffa6ce9..af1b35c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - smalltalk: [ Pharo64-10, Pharo64-8.0, Pharo64-9.0 ] + smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-8.0, Pharo64-9.0 ] name: ${{ matrix.smalltalk }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Start httpbin run: docker run -d -p 127.0.0.1:80:80 fortizpenaloza/httpbin - name: Start memcached @@ -26,7 +26,7 @@ jobs: - name: Run tests using Docker 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 d83d521..06a5a79 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Building blocks for creating HTTP requests and API clients [![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 diff --git a/api-tests/Dockerfile b/api-tests/Dockerfile index b65c185..40cefb5 100644 --- a/api-tests/Dockerfile +++ b/api-tests/Dockerfile @@ -1,26 +1,22 @@ # Stage 1: Load the project -FROM basmalltalk/pharo:8.0-image AS loader -ARG BRANCH_NAME=release-candidate -ENV BRANCH_NAME=$BRANCH_NAME -COPY load-project.st ./ -RUN pharo Pharo.image load-project.st --save --quit +FROM ghcr.io/ba-st/pharo-loader:v11.0.0 AS loader + +COPY --chown=pharo:users ./source ./source +COPY --chown=pharo:users ./.git ./.git +RUN pharo metacello install gitlocal://./source BaselineOfSuperluminal --groups=Examples # Stage 2: Copy the resulting Pharo.image with our project loaded # into a new docker image with just the vm -FROM basmalltalk/pharo:8.0 +FROM ghcr.io/ba-st/launchpad:v4 USER root -WORKDIR /opt/app -COPY start.sh ./ COPY --from=loader /opt/pharo/Pharo.image ./ -COPY --from=loader /opt/pharo/Pharo.changes ./ COPY --from=loader /opt/pharo/Pharo*.sources ./ RUN mkdir logs \ - && chmod a+x start.sh \ - && chown --recursive pharo:users /opt/app + && chown --recursive pharo:users /opt/pharo USER pharo -CMD ["./start.sh"] +CMD ["launchpad-start", "superluminal-service-discovery", "--retry-delay-in-ms=10000"] diff --git a/api-tests/docker-compose.yml b/api-tests/docker-compose.yml index fb1f39c..ce2f54b 100644 --- a/api-tests/docker-compose.yml +++ b/api-tests/docker-compose.yml @@ -23,9 +23,8 @@ services: CONSUL_BIND_INTERFACE: eth0 api-client: build: - context: ./ - args: - - BRANCH_NAME + context: ../ + dockerfile: api-tests/Dockerfile environment: MESSAGE: 'Hello' CONSUL_AGENT_LOCATION: http://consul-agent:8500 diff --git a/api-tests/load-project.st b/api-tests/load-project.st deleted file mode 100644 index 3756ce2..0000000 --- a/api-tests/load-project.st +++ /dev/null @@ -1,11 +0,0 @@ -| branchName | - -EpMonitor current disable. - -branchName := Smalltalk os environment at: 'BRANCH_NAME' ifAbsent: [Error signal: 'BRANCH_NAME environment variable not set']. -branchName ifEmpty: [ Error signal: 'BRANCH_NAME environment variable value is empty']. - -Metacello new - baseline: 'Superluminal'; - repository: ('github://ba-st/Superluminal:<1s>' expandMacrosWith: branchName); - load: 'Examples'. diff --git a/api-tests/start.sh b/api-tests/start.sh deleted file mode 100644 index 5f7bca8..0000000 --- a/api-tests/start.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -exec /opt/pharo/pharo \ - /opt/app/Pharo.image \ - launchpad start superluminal-service-discovery \ - --retry-delay-in-ms=10000 diff --git a/compose-test.sh b/compose-test.sh index 62bfa3a..5cd033f 100755 --- a/compose-test.sh +++ b/compose-test.sh @@ -8,4 +8,8 @@ else echo "BRANCH_NAME=${GITHUB_HEAD_REF##*/}" > api-tests/.env fi set +e # disable exit on error to be able to catch the exit code from compose -docker-compose -f api-tests/docker-compose.yml up --exit-code-from api-client +docker compose \ + --file api-tests/docker-compose.yml \ + up \ + --build api-client \ + --exit-code-from api-client diff --git a/source/BaselineOfSuperluminal/BaselineOfSuperluminal.class.st b/source/BaselineOfSuperluminal/BaselineOfSuperluminal.class.st index 99c6247..ba39329 100644 --- a/source/BaselineOfSuperluminal/BaselineOfSuperluminal.class.st +++ b/source/BaselineOfSuperluminal/BaselineOfSuperluminal.class.st @@ -45,23 +45,23 @@ BaselineOfSuperluminal >> setUpDependencies: spec [ project: 'Launchpad-Deployment' copyFrom: 'Launchpad' with: [ spec loads: 'Deployment' ]. spec - baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:master/repository' ]; + baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:master' ]; project: 'NeoJSON-Core' copyFrom: 'NeoJSON' with: [ spec loads: 'core' ]. spec - baseline: 'ObjectPool' with: [ spec repository: 'github://pharo-ide/ObjectPool:v1.0.2' ]; + baseline: 'ObjectPool' with: [ spec repository: 'github://pharo-ide/ObjectPool:v1.0.3' ]; project: 'ObjectPool-Core' copyFrom: 'ObjectPool' with: [ spec loads: 'Core' ]. spec - baseline: 'Teapot' with: [ spec repository: 'github://zeroflag/Teapot:v2.6.0/source' ]; + baseline: 'Teapot' with: [ spec repository: 'github://zeroflag/Teapot:v2.7.0/source' ]; project: 'Teapot-Deployment' copyFrom: 'Teapot' with: [ spec loads: 'Deployment' ]. spec - baseline: 'Teachable' with: [ spec repository: 'github://astares/Pharo-Teachable:master/src' ]; + baseline: 'Teachable' with: [ spec repository: 'github://astares/Pharo-Teachable:master' ]; project: 'Teachable-Core' copyFrom: 'Teachable' with: [ spec loads: 'Core' ]. spec - baseline: 'Memcached' with: [ spec repository: 'github://svenvc/memcached:v1' ]; + baseline: 'Memcached' with: [ spec repository: 'github://svenvc/memcached:master' ]; project: 'Memcached-Core' copyFrom: 'Memcached' with: [ spec loads: 'Deployment' ] ] From 41d0c11372c263d202830bc27bf8d06295ca00be Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 18:52:45 -0300 Subject: [PATCH 2/5] Update Dockerfile --- api-tests/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api-tests/Dockerfile b/api-tests/Dockerfile index 40cefb5..6b8e205 100644 --- a/api-tests/Dockerfile +++ b/api-tests/Dockerfile @@ -1,9 +1,9 @@ # Stage 1: Load the project FROM ghcr.io/ba-st/pharo-loader:v11.0.0 AS loader -COPY --chown=pharo:users ./source ./source -COPY --chown=pharo:users ./.git ./.git -RUN pharo metacello install gitlocal://./source BaselineOfSuperluminal --groups=Examples +COPY --chown=pharo:users ./source /opt/pharo/source +COPY --chown=pharo:users ./.git /opt/pharo/.git +RUN pharo metacello install gitlocal:///opt/pharo//opt/pharo/source BaselineOfSuperluminal --groups=Examples # Stage 2: Copy the resulting Pharo.image with our project loaded # into a new docker image with just the vm From 29e3e4e48fbe3c7a758f645b42974cffa3edccd0 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 18:56:05 -0300 Subject: [PATCH 3/5] Fix Dockerfile --- api-tests/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-tests/Dockerfile b/api-tests/Dockerfile index 6b8e205..564ead9 100644 --- a/api-tests/Dockerfile +++ b/api-tests/Dockerfile @@ -3,7 +3,7 @@ FROM ghcr.io/ba-st/pharo-loader:v11.0.0 AS loader COPY --chown=pharo:users ./source /opt/pharo/source COPY --chown=pharo:users ./.git /opt/pharo/.git -RUN pharo metacello install gitlocal:///opt/pharo//opt/pharo/source BaselineOfSuperluminal --groups=Examples +RUN pharo metacello install gitlocal:///opt/pharo/source BaselineOfSuperluminal --groups=Examples # Stage 2: Copy the resulting Pharo.image with our project loaded # into a new docker image with just the vm From f88687fda37fa7ffe2d1910a0ca3b0cfd386979d Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 19:01:56 -0300 Subject: [PATCH 4/5] Move integration tests to another workflow --- .github/workflows/integration-tests.yml | 12 ++++++++++++ .github/workflows/unit-tests.yml | 2 -- api-tests/Dockerfile | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/integration-tests.yml diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000..3421ce5 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,12 @@ +name: Integration Tests + +on: [push,pull_request,workflow_dispatch] + +jobs: + integration-tests: + runs-on: ubuntu-latest + name: Integration Tests + steps: + - uses: actions/checkout@v3 + - name: Run tests using Docker + run: ./compose-test.sh diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index af1b35c..eba8068 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -23,8 +23,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 15 - - name: Run tests using Docker - run: ./compose-test.sh - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/api-tests/Dockerfile b/api-tests/Dockerfile index 564ead9..c608d10 100644 --- a/api-tests/Dockerfile +++ b/api-tests/Dockerfile @@ -3,7 +3,7 @@ FROM ghcr.io/ba-st/pharo-loader:v11.0.0 AS loader COPY --chown=pharo:users ./source /opt/pharo/source COPY --chown=pharo:users ./.git /opt/pharo/.git -RUN pharo metacello install gitlocal:///opt/pharo/source BaselineOfSuperluminal --groups=Examples +RUN pharo metacello install gitlocal://. BaselineOfSuperluminal --groups=Examples # Stage 2: Copy the resulting Pharo.image with our project loaded # into a new docker image with just the vm From 54c688d93235358b9559a8ad92d31d60f4b67541 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 19:06:24 -0300 Subject: [PATCH 5/5] Update integration tests --- .github/workflows/integration-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3421ce5..47844cf 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -8,5 +8,7 @@ jobs: name: Integration Tests steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Run tests using Docker run: ./compose-test.sh