Repository navigation
63 lines (52 loc) · 1.76 KB
/
Copy pathci.yml
File metadata and controls
63 lines (52 loc) · 1.76 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
# What holds true of this repository, every time again.
#
# One job, because every step is quick: the tests compile the SCSS with
# dart-sass in-process, and the build is two Vite passes over the same
# source. Lint, formatting and types first, since they fail fastest; then
# the tests with coverage; then the build, because a theme that tests
# green and does not compile into dist/ is not done.
name: CI
on:
push:
# `main` is the default branch here.
branches: [main, dev]
pull_request:
workflow_dispatch:
# A new push to the same branch makes the previous one redundant.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Nothing here writes anything back. `packages: read` is for the
# @stylescape scope in GitHub Packages; stylescape core itself comes from
# the public npm registry.
permissions:
contents: read
packages: read
jobs:
check:
name: Lint, formatting, types, tests and builds
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
registry-url: https://npm.pkg.github.com
scope: "@stylescape"
# The package and the registry are both stylescape's, so the
# workflow's own GITHUB_TOKEN is enough to read the scope; no PAT.
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: ESLint
run: npm run lint
- name: Formatting (Prettier)
run: npm run format:check
- name: Typecheck (tsc)
run: npm run typecheck
- name: Tests with coverage (node:test)
run: npm run coverage
- name: The build has to work
run: npm run build