-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (71 loc) · 2.6 KB
/
ci.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
actions: read
contents: read
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 9
# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4
- name: Run license check
run: npx license-checker --onlyAllow "MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;0BSD"
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build keycloak
run: |
cd deploys/keycloak &&
docker compose pull keycloak &&
docker compose build keycloak
- name: Add entry to /etc/hosts
run: echo "127.0.0.1 host.testcontainers.internal" | sudo tee -a /etc/hosts
- name: Lint, test, container, e2e
run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} pnpm exec nx affected -t lint test container e2e
# comment out since the current e2e tests do not produce any artifacts
# - name: Upload coverage
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload playwright results
if: always() && steps.check_playwright_results.outputs.exists == 'true'
uses: actions/upload-artifact@v4
with:
name: playwright-results
path: dist/.playwright
retention-days: 30
- name: Check if playwright results exist
id: check_playwright_results
run: echo "exists=$(if [ -d dist/.playwright ]; then echo true; else echo false; fi)" >> $GITHUB_ENV
- name: Upload testcontainer logs
if: always() && steps.check_testcontainer_logs.outputs.exists == 'true'
uses: actions/upload-artifact@v4
with:
name: testcontainer-logs
path: tmp/logs
retention-days: 30
# validate if the .env.example files in the deploys folder are up to date and that the containers can be health checked and started
- name: Validate deploy environment
run:
cd deploys &&
./test.sh
- name: Check if testcontainer logs exist
id: check_testcontainer_logs
run: echo "exists=$(if [ -d tmp/logs ]; then echo true; else echo false; fi)" >> $GITHUB_ENV