-
Notifications
You must be signed in to change notification settings - Fork 55
75 lines (69 loc) · 2.4 KB
/
build.yml
File metadata and controls
75 lines (69 loc) · 2.4 KB
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
name: Build CHT Conf and test against node versions
on: [push, pull_request]
jobs:
build:
name: Build for Node version ${{ matrix.node-version }}
runs-on: ubuntu-22.04
env:
FORCE_COLOR: 1
strategy:
matrix:
node-version: [ 20.x, 22.x, 24.x ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run eslint
- run: npm test
- name: Archive Results
uses: actions/upload-artifact@v4
with:
name: Coverage Report ${{ matrix.node-version }}
path: |
coverage
.nyc_output
if: ${{ failure() }}
e2e:
name: E2E tests
runs-on: ubuntu-22.04
env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REDIRECT_URI: "http://localhost"
GOOGLE_TOKEN_SCOPE: 'https://www.googleapis.com/auth/drive.readonly'
RUN_GOOGLE_TESTS: ${{ secrets.GOOGLE_CREDENTIALS != '' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.x
- name: Set system ulimit
uses: medic/cht-core/.github/actions/bump-system-ulimit@476c97b0427e75ebdc1745afb5c73da0574f963a
- name: Install dependencies
run: npm ci
- name: Hard code local-ip IP in /etc/hosts per https://github.com/medic/medic-infrastructure/issues/571#issuecomment-2209120441
run: |
echo "15.188.129.97 local-ip.medicmobile.org" | sudo tee -a /etc/hosts
- id: auth
if: ${{ env.RUN_GOOGLE_TESTS == 'true' }}
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
with:
service_account: ${{ env.GOOGLE_SERVICE_ACCT }}
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
token_format: access_token
access_token_scopes: ${{ env.GOOGLE_TOKEN_SCOPE }}
- name: Write access_token to .gdrive.session.json
if: ${{ env.RUN_GOOGLE_TESTS == 'true' }}
run: |
echo '{
"access_token": "${{ steps.auth.outputs.access_token }}",
"scope": "${{ env.GOOGLE_TOKEN_SCOPE }}",
"token_type": "Bearer",
"expiry_date": "9999999999999"
}' > .gdrive.session.json
- name: Run E2E tests
run: npm run test-e2e