This repository has been archived by the owner on May 6, 2024. It is now read-only.
Merge pull request #145 from carbon-budget-explorer/prep-release #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: ⬣ ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
cache-dependency-path: ./package.json | |
node-version: 18 | |
- name: 📥 Install deps | |
run: npm ci | |
- name: 🔬 Lint | |
run: npm run lint | |
typecheck: | |
name: ʦ TypeScript | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
cache-dependency-path: ./package.json | |
node-version: 18 | |
- name: 📥 Install deps | |
run: npm ci | |
- name: 🔎 Type check | |
run: npm run check | |
unit: | |
name: ⚡ Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
cache-dependency-path: ./package.json | |
node-version: 18 | |
- name: 📥 Install deps | |
run: npm ci | |
- name: ⚡ Run vitest | |
run: npm run test:unit -- --coverage | |
e2e: | |
name: ⚫️ e2e | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
cache-dependency-path: ./package.json | |
node-version: 18 | |
- name: 📥 Install deps | |
run: npm ci | |
- name: ⬇️ Install data deps | |
run: npm run download:borders | |
- name: 🛠 Setup browsers | |
run: npx playwright install | |
- name: 🎭 Playwright run | |
run: npm test | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ⎔ Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: npm | |
cache-dependency-path: ./package.json | |
node-version: 18 | |
- name: 📥 Install deps | |
run: npm ci | |
- name: ⬇️ Install data deps | |
run: npm run download:borders | |
- name: ⚙️ Build | |
run: npm run build | |
python: | |
name: 🐍 Python | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: ⎔ Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: 📥 Install deps | |
run: pip install -r requirements.txt | |
- name: 🐍 Syntax check | |
run: python -m py_compile ws.py | |
# TODO add mypy, ruff, black checks |