Skip to content

Commit 30c7324

Browse files
committed
[CI] Add integration test workflow
1 parent b7c65a4 commit 30c7324

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Integration Test
2+
on:
3+
workflow_call:
4+
push:
5+
branches: [main]
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}-integration-test
8+
cancel-in-progress: true
9+
jobs:
10+
integration-test:
11+
name: Integration Test
12+
runs-on: ubuntu-22.04
13+
timeout-minutes: 10
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
toolchain: [latest]
18+
steps:
19+
- name: Install Swift
20+
uses: vapor/swiftly-action@v0.1
21+
with:
22+
toolchain: ${{ matrix.toolchain }}
23+
env:
24+
SWIFTLY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Checkout
26+
uses: actions/checkout@v4.2.2
27+
- name: Resolve Swift dependencies
28+
run: swift package resolve
29+
working-directory: ./IntegrationTests
30+
- name: Start Services
31+
run: docker compose up -d
32+
working-directory: ./IntegrationTests
33+
- name: Run Integration Tests
34+
run: swift test --parallel
35+
working-directory: ./IntegrationTests
36+
- name: Export service logs
37+
if: always()
38+
working-directory: ./IntegrationTests
39+
run: |
40+
docker compose logs --no-color > docker-compose-logs.txt
41+
docker compose down
42+
- name: Upload service logs
43+
uses: actions/upload-artifact@v4.6.0
44+
if: failure()
45+
with:
46+
name: docker-compose-logs.txt
47+
path: IntegrationTests/docker-compose-logs.txt

.github/workflows/pull-request.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ jobs:
1313
name: Unit Test
1414
uses: ./.github/workflows/unit-test.yaml
1515
secrets: inherit
16+
17+
integration_test:
18+
name: Integration Test
19+
uses: ./.github/workflows/integration-test.yaml

0 commit comments

Comments
 (0)