-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Revert "Ability to run Github Action code locally (#4072)" This reverts commit b2d9137. * give development_workflow test more time to start server * add simple script to run integration tests locally * run integration tests with more versions * do not duplicate integration test code
- Loading branch information
Showing
6 changed files
with
98 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
- elixir: 1.14.5 | ||
otp: 25.3 | ||
|
||
- elixir: 1.16.0 | ||
- elixir: 1.16.2 | ||
otp: 26.2 | ||
lint: true | ||
installer: true | ||
|
@@ -106,18 +106,44 @@ jobs: | |
integration-test-elixir: | ||
runs-on: ubuntu-latest | ||
env: | ||
FORCE_COLOR: 1 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- elixir: 1.14.0 | ||
otp: 24.3.4 | ||
# look for correct alpine image here: https://hub.docker.com/r/hexpm/elixir/tags | ||
- elixir: 1.14.5 | ||
otp: 25.3.2.12 | ||
suffix: "alpine-3.19.1" | ||
|
||
- elixir: 1.16.2 | ||
otp: 26.2.5 | ||
suffix: "alpine-3.19.1" | ||
|
||
container: | ||
image: hexpm/elixir:${{ matrix.elixir }}-erlang-${{ matrix.otp }}-${{ matrix.suffix }} | ||
env: | ||
ELIXIR_ASSERT_TIMEOUT: 10000 | ||
services: | ||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
mysql: | ||
image: mysql | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
mssql: | ||
image: mcr.microsoft.com/mssql/server:2019-latest | ||
env: | ||
ACCEPT_EULA: Y | ||
SA_PASSWORD: some!Password | ||
ports: | ||
- 1433:1433 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download released earth | ||
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.5.16/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" | ||
- name: Execute tests | ||
run: earthly -P --build-arg ELIXIR=${{ matrix.elixir }} --build-arg OTP=${{ matrix.otp }} +integration-test | ||
- uses: actions/[email protected] | ||
- name: Run test script | ||
run: ./integration_test/test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env sh -e | ||
|
||
# adapt with versions from .github/versions/ci.yml if necessary; | ||
# you can also override these with environment variables | ||
ELIXIR="${ELIXIR:-1.16.2}" | ||
ERLANG="${ERLANG:-26.2.5}" | ||
SUFFIX="${SUFFIX:-alpine-3.19.1}" | ||
|
||
# Get the directory of the script | ||
SCRIPT_DIR=$(dirname "$(readlink -f "$0")") | ||
|
||
# Get the parent directory | ||
PARENT_DIR=$(dirname "$SCRIPT_DIR") | ||
|
||
# Check if docker-compose is available | ||
if command -v docker-compose &> /dev/null | ||
then | ||
COMPOSE_CMD="docker-compose" | ||
elif docker compose version &> /dev/null | ||
then | ||
COMPOSE_CMD="docker compose" | ||
else | ||
echo "Error: Neither docker-compose nor the docker compose plugin is available." | ||
exit 1 | ||
fi | ||
|
||
# Start databases | ||
$COMPOSE_CMD up -d | ||
|
||
# Run test script in container | ||
docker run --rm --network=integration_test_default \ | ||
-w $PARENT_DIR -v $PARENT_DIR:$PARENT_DIR \ | ||
-it hexpm/elixir:$ELIXIR-erlang-$ERLANG-$SUFFIX sh integration_test/test.sh | ||
|
||
$COMPOSE_CMD down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh -e | ||
|
||
mix local.rebar --force | ||
mix local.hex --force | ||
|
||
# Install Dependencies | ||
apk add --no-progress --update git socat make gcc libc-dev | ||
|
||
# Set up local proxies | ||
socat TCP-LISTEN:5432,fork TCP-CONNECT:postgres:5432& | ||
socat TCP-LISTEN:3306,fork TCP-CONNECT:mysql:3306& | ||
socat TCP-LISTEN:1433,fork TCP-CONNECT:mssql:1433& | ||
|
||
# Run installer tests | ||
echo "Running installer tests" | ||
cd installer | ||
mix test | ||
|
||
echo "Running integration tests" | ||
cd ../integration_test | ||
mix deps.get | ||
mix test --include database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters