From 2b0918ffb357b7a2e467da9d3e9953d5d4d3ad33 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Tue, 14 Nov 2023 19:03:36 +0100 Subject: [PATCH] Add integration test --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ lib/action/pipeline_awaiter.rb | 1 + lib/action/step/start_runner.rb | 1 + 3 files changed, 26 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..94ad4fb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: Run Integration test + +on: + push: + pull_request: + +jobs: + integration-test: + runs-on: ubuntu-latest + + steps: + - run: actions/checkout@v4 + - run: docker compose up -d + working-directory: test + - run: test/await_healthy.sh + - uses: ./ + name: Run test + with: + GL_SERVER_URL: http://127.0.0.1:8080 + GL_PROJECT_ID: '1000' + GL_RUNNER_TOKEN: some_long_runner_token + GL_API_TOKEN: TEST1234567890123456 + - run: docker compose down + working-directory: test diff --git a/lib/action/pipeline_awaiter.rb b/lib/action/pipeline_awaiter.rb index cc7743e..32448fb 100644 --- a/lib/action/pipeline_awaiter.rb +++ b/lib/action/pipeline_awaiter.rb @@ -26,6 +26,7 @@ def wait! puts "Pipeline succeeded in #{duration} minutes!" return else + puts puts "Pipeline #{status} in #{duration} minutes!" raise PipelineFailed, 'Pipeline did not succeed!' end diff --git a/lib/action/step/start_runner.rb b/lib/action/step/start_runner.rb index fa7f5e3..fd692e4 100644 --- a/lib/action/step/start_runner.rb +++ b/lib/action/step/start_runner.rb @@ -13,6 +13,7 @@ def execute 'Binds' => [ '/var/run/docker.sock:/var/run/docker.sock:ro' ], + 'NetworkMode' => 'host' } )