0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00
logto/.github/workflows/integration-test.yml

65 lines
2.3 KiB
YAML
Raw Normal View History

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:
concurrency:
2023-01-19 11:22:17 +08:00
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
package:
strategy:
matrix:
# Run the integration tests with and without dev features enabled
dev-features-enabled: [true, false]
# An error will occur if we use a newer version of Ubuntu in the CI environment, as it has restrictions on unprivileged user namespaces and sandbox usage, which prevents Chromium (used by Puppeteer) from launching properly during integration tests. So we lock the Ubuntu version to 22.04.
# See error record: https://github.com/logto-io/logto/actions/runs/12803809008/job/35697654974
runs-on: ubuntu-22.04
env:
INTEGRATION_TEST: true
DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }}
steps:
- uses: logto-io/actions-package-logto-artifact@v3
with:
artifact-name: integration-test-${{ github.sha }}-dev-features-${{ matrix.dev-features-enabled }}
pnpm-version: 9
run-logto:
strategy:
2023-03-28 12:00:28 +08:00
fail-fast: false
matrix:
target: [api, experience, console]
# 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
runs-on: ubuntu-22.04
2023-03-06 00:48:50 +08:00
env:
INTEGRATION_TEST: true
DEV_FEATURES_ENABLED: ${{ matrix.dev-features-enabled }}
DB_URL: postgres://postgres:postgres@localhost:5432/postgres
steps:
- uses: logto-io/actions-run-logto-integration-tests@v4
with:
logto-artifact: integration-test-${{ github.sha }}-dev-features-${{ env.DEV_FEATURES_ENABLED }}
test-target: ${{ matrix.target }}
pnpm-version: 9
# 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-22.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}