-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (78 loc) · 2.23 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- "**"
merge_group:
types:
- checks_requested
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 18 # Adjust the Node.js version as needed
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run linting
working-directory: ./query-connector
run: |
npm ci
npm run lint
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install dependencies
working-directory: ./query-connector
run: npm install
- name: Run tests
working-directory: ./query-connector
run: npm test
end-to-end-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install dependencies
working-directory: ./query-connector
run: npm ci
- name: Install Playwright Browsers
working-directory: ./query-connector
run: npx playwright install --with-deps
- name: Build Query Connector
working-directory: ./query-connector
run: docker compose build --no-cache
- name: Run Query Connector
working-directory: ./query-connector
run: docker compose up -d
- name: Poll until Query Connector is ready
run: |
until curl -s http://localhost:3000/tefca-viewer; do
echo "Waiting for Query Connector to be ready before running Playwright..."
sleep 5
done
- name: Playwright Tests
working-directory: ./query-connector
run: npx playwright test e2e --reporter=list --config playwright.config.ts
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: ./query-connector/test-results/