[CI] Add integration test workflow #1
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
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: failure() | |
with: | |
name: docker-compose-logs.txt | |
path: IntegrationTests/docker-compose-logs.txt |