2022-05-10 15:29:53 +08:00
|
|
|
name: Integration Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-07-01 20:33:08 +08:00
|
|
|
branches:
|
|
|
|
- master
|
2022-06-27 16:38:39 +08:00
|
|
|
pull_request:
|
2022-06-17 23:58:29 +08:00
|
|
|
|
2022-07-26 16:12:34 +08:00
|
|
|
concurrency:
|
2023-01-19 11:22:17 +08:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-06-17 23:58:29 +08:00
|
|
|
cancel-in-progress: true
|
2022-05-10 15:29:53 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
package:
|
2024-06-29 13:40:40 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# Run the integration tests with and without dev features enabled
|
|
|
|
dev-features-enabled: [true, false]
|
2024-05-13 16:24:28 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-09-15 15:43:03 +08:00
|
|
|
env:
|
|
|
|
INTEGRATION_TEST: true
|
2024-06-29 13:40:40 +08:00
|
|
|
DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }}
|
2023-09-15 15:43:03 +08:00
|
|
|
|
2022-05-10 15:29:53 +08:00
|
|
|
steps:
|
2024-07-04 14:18:23 +08:00
|
|
|
- uses: logto-io/actions-package-logto-artifact@v3
|
2022-05-10 15:29:53 +08:00
|
|
|
with:
|
2024-06-29 13:40:40 +08:00
|
|
|
artifact-name: integration-test-${{ github.sha }}-dev-features-${{ matrix.dev-features-enabled }}
|
2024-05-09 08:42:31 +00:00
|
|
|
pnpm-version: 9
|
2022-07-26 16:12:34 +08:00
|
|
|
|
2022-05-10 15:29:53 +08:00
|
|
|
run-logto:
|
|
|
|
strategy:
|
2023-03-28 12:00:28 +08:00
|
|
|
fail-fast: false
|
2022-05-10 15:29:53 +08:00
|
|
|
matrix:
|
2023-09-14 17:28:00 +08:00
|
|
|
target: [api, experience, console]
|
2024-06-29 13:40:40 +08:00
|
|
|
# Run the integration tests with and without dev features enabled
|
|
|
|
dev-features-enabled: [true, false]
|
2023-03-06 00:48:50 +08:00
|
|
|
needs: package
|
2022-11-07 23:11:21 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-03-06 00:48:50 +08:00
|
|
|
env:
|
|
|
|
INTEGRATION_TEST: true
|
2024-06-29 13:40:40 +08:00
|
|
|
DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }}
|
2023-05-30 10:50:06 +08:00
|
|
|
DB_URL: postgres://postgres:postgres@localhost:5432/postgres
|
2022-05-10 15:29:53 +08:00
|
|
|
|
|
|
|
steps:
|
2024-07-04 14:18:03 +08:00
|
|
|
- uses: logto-io/actions-run-logto-integration-tests@v4
|
2022-05-10 15:29:53 +08:00
|
|
|
with:
|
2024-06-29 13:40:40 +08:00
|
|
|
logto-artifact: integration-test-${{ github.sha }}-dev-features-${{ env.DEV_FEATURES_ENABLED }}
|
2024-05-09 08:42:31 +00:00
|
|
|
test-target: ${{ matrix.target }}
|
|
|
|
pnpm-version: 9
|
2024-07-01 20:15:40 +08:00
|
|
|
|
|
|
|
# Automatically rerun the workflow since the integration tests are moody
|
|
|
|
# From this genius: https://github.com/orgs/community/discussions/67654#discussioncomment-8038649
|
|
|
|
rerun-on-failure:
|
|
|
|
needs: run-logto
|
|
|
|
if: failure() && fromJSON(github.run_attempt) < 3
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- env:
|
|
|
|
GH_REPO: ${{ github.repository }}
|
|
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
GH_DEBUG: api
|
2024-07-03 10:35:19 +08:00
|
|
|
run: gh workflow run rerun.yml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}
|