-
-
Notifications
You must be signed in to change notification settings - Fork 453
62 lines (55 loc) · 1.91 KB
/
integration-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Integration Test
on:
push:
branches:
- master
pull_request:
concurrency:
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]
runs-on: ubuntu-latest
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:
fail-fast: false
matrix:
target: [api, experience, console]
# Run the integration tests with and without dev features enabled
dev-features-enabled: [true, false]
needs: package
runs-on: ubuntu-latest
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-latest
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 }}