Skip to content

Commit

Permalink
[CI] Add integration test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
slashmo committed Jan 27, 2025
1 parent b7c65a4 commit 12139fc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Integration Test
on:
workflow_call:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-integration-test
cancel-in-progress: true
jobs:
integration-test:
name: Integration Test
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
toolchain: [latest]
steps:
- name: Install Swift
uses: vapor/[email protected]
with:
toolchain: ${{ matrix.toolchain }}
env:
SWIFTLY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/[email protected]
- name: Resolve Swift dependencies
run: swift package resolve
working-directory: ./IntegrationTests
- name: Start Services
run: docker compose up -d
working-directory: ./IntegrationTests
- name: Run Integration Tests
run: swift test --parallel
working-directory: ./IntegrationTests
- name: Export service logs
if: always()
working-directory: ./IntegrationTests
run: |
docker compose logs --no-color > docker-compose-logs.txt
docker compose down
- name: Upload service logs
uses: actions/[email protected]
if: always()
with:
name: docker-compose-logs.txt
path: IntegrationTests/docker-compose-logs.txt
if-no-files-found: error
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ jobs:
name: Unit Test
uses: ./.github/workflows/unit-test.yaml
secrets: inherit

integration_test:
name: Integration Test
uses: ./.github/workflows/integration-test.yaml

0 comments on commit 12139fc

Please sign in to comment.