-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (64 loc) · 2.19 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
name: CI
on:
pull_request:
branches:
- develop
- 'release-**'
env:
CI: true
DES_IONIC_CONFIG_JSON: ${{ secrets.DES_IONIC_CONFIG_JSON }}
DES_IONIC_KEY: ${{ secrets.DES_IONIC_KEY }}
DES_ACCESS_TOKEN: ${{ secrets.DES_ACCESS_TOKEN }}
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: mito-2
outputs:
node-version: ${{ steps.nvm.outputs.NVMRC }}
steps:
- name: 📨 Checkout
uses: actions/checkout@v4
- name: 🔍 Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: 🔧 Create .npmrc
run: |
echo "//npm.pkg.github.com/:_authToken=$DES_ACCESS_TOKEN" >> ~/.npmrc
# Use npm registry for @dvsa/biome-config
echo "@dvsa/biome-config:registry=https://registry.npmjs.org/" >> .npmrc
# Use GitHub Packages registry for all other @dvsa scoped packages
echo "@dvsa:registry=https://npm.pkg.github.com" >> .npmrc
echo "@ionic-enterprise:registry=https://registry.ionicframework.com/" >> .npmrc
echo "//registry.ionicframework.com/:_authToken=$DES_IONIC_KEY" >> .npmrc
- name: 🔧 Create ionic.config.json
run: echo "$DES_IONIC_CONFIG_JSON" >> ionic.config.json
audit:
runs-on: mito-2
needs: [ setup ]
steps:
- name: ⚙️ Setup Node.js ${{ needs.setup.outputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ needs.setup.outputs.node-version }}
- name: ➕ Install dependencies
run: npm ci
- name: 🕵️♀️ Audit production dependencies
run: npm audit --omit=dev --audit-level=high
ci-checks:
runs-on: mito-2
needs: [ setup ]
steps:
- name: ⚙️ Setup Node.js ${{ needs.setup.outputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ needs.setup.outputs.node-version }}
- name: ➕ Install dependencies
run: npm ci
- name: ⚒️ Build project
run: npm run build:ci
- name: 📝 Lint codebase
run: npm run lint
- name: 🧪️ Execute unit tests
run: npm run test