-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (140 loc) · 4.34 KB
/
pull-request.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- main
schedule:
- cron: 0 0 * * *
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit-test-react:
name: node packages
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
pkg: [opa-wasm]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "21.x"
- uses: open-policy-agent/setup-opa@v2
- name: setup and test
run: |
npm ci
npm test
working-directory: client/react/packages/${{ matrix.pkg }}
build-clients:
name: build client
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
client: [html, react]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: open-policy-agent/setup-opa@v2
- name: build wasm bundle
run: make client/react/public/opa.wasm
env:
OPA: opa
if: ${{ matrix.client == 'react' }}
- name: setup
run: docker compose --profile ${{ matrix.client }} up --quiet-pull --wait --wait-timeout 300 --build
- name: smoke test
run: curl --retry 5 --retry-connrefused --retry-max-time 120 http://127.0.0.1:3000 -v
test-e2e:
name: Test E2E
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
server: [node, csharp, java, springboot]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup
run: docker compose --profile ${{ matrix.server }} --profile react up --quiet-pull --wait --wait-timeout 300
- name: Install dependencies
run: npm ci
working-directory: tests/e2e
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: tests/e2e
- name: Run Playwright tests
run: npx playwright test
working-directory: tests/e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.server }}
path: tests/e2e/playwright-report/
retention-days: 7
- name: Run hurl API tests
run: docker compose run --quiet-pull integration-tests
env:
VARIANT: ${{ matrix.server }}
- name: dump logs
run: docker compose --profile ${{ matrix.server }} logs
if: failure()
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Results for server-${{ matrix.server }}
report_paths: tests/api/report.xml
test-e2e-batch:
name: Test E2E Batching
runs-on: ubuntu-22.04
env:
eopa_license: ${{ secrets.EOPA_LICENSE_KEY }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
if: env.eopa_license != ''
- name: setup
run: docker compose --profile node --profile react up --quiet-pull --wait --wait-timeout 300
env:
OPA_DOCKERFILE: enterprise-opa.Dockerfile
EOPA_LICENSE_KEY: ${{ secrets.EOPA_LICENSE_KEY }}
if: env.eopa_license != ''
- name: Install dependencies
run: npm ci
working-directory: tests/e2e
if: env.eopa_license != ''
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: tests/e2e
if: env.eopa_license != ''
- name: Run Playwright tests
run: npx playwright test
working-directory: tests/e2e
env:
BATCHING: true
if: env.eopa_license != ''
- uses: actions/upload-artifact@v4
with:
name: playwright-report-batching-node
path: tests/e2e/playwright-report/
retention-days: 7
if: env.eopa_license != '' && always()
- name: dump logs
run: docker compose --profile node logs
if: env.eopa_license != '' && always()