Skip to content

mes-8942-MOTAnalytics #1252

mes-8942-MOTAnalytics

mes-8942-MOTAnalytics #1252

Workflow file for this run

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