Skip to content

Commit

Permalink
Add Pharo 11 support
Browse files Browse the repository at this point in the history
Move integration tests to its own GitHub workflow
Update Dockerfile to use Pharo 11
  • Loading branch information
gcotelli committed May 24, 2023
1 parent 77732c3 commit e7a44b5
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 40 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/loading-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ 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)

[![GitHub release](https://img.shields.io/github/release/ba-st/Stargate-Consul.svg)](https://github.com/ba-st/Stargate-Consul/releases/latest)
[![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

Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions compose-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
13 changes: 4 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
# 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
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 ./
Expand Down

0 comments on commit e7a44b5

Please sign in to comment.