-
Notifications
You must be signed in to change notification settings - Fork 178
94 lines (88 loc) · 2.96 KB
/
js-check.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
84
85
86
87
88
89
90
91
92
93
94
# This workflow runs checks (types, formatting, style) for our js projects
# which cannot be meaningfully separated
name: 'JS checks'
on:
pull_request:
paths:
- '**/*.js'
- './.*.js'
- '**/*.ts'
- '**/*.tsx'
- '**/*.json'
- '**/*.css'
- '**/*.md'
push:
paths:
- '**/*.js'
- './.*.js'
- '**/*.ts'
- '**/*.tsx'
- '**/*.json'
- '**/*.md'
- '.github/workflows/js-check.yaml'
- '**/*.css'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.ref_name != 'edge' || github.run_id}}-${{ github.ref_type != 'tag' || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
CI: true
jobs:
checks:
name: 'js checks'
runs-on: 'ubuntu-22.04'
timeout-minutes: 20
steps:
- uses: 'actions/checkout@v3'
- uses: 'actions/setup-node@v3'
with:
node-version: '18.19.0'
- name: 'set complex environment variables'
id: 'set-vars'
uses: actions/github-script@v6
with:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'install libudev for usb-detection'
run: |
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
id: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
# Use the if to run all the lint checks even of some fail
shell: bash
- name: 'lint js'
if: always() && steps.setup-js.outcome == 'success'
run: make lint-js
- name: 'typechecks'
if: always() && steps.setup-js.outcome == 'success'
run: make check-js
- name: 'circular deps'
if: always() && steps.setup-js.outcome == 'success'
run: make circular-dependencies-js
- name: 'lint json'
if: always() && steps.setup-js.outcome == 'success'
run: make lint-json
- name: 'lint css'
if: always() && steps.setup-js.outcome == 'success'
run: make lint-css
- name: 'test scripts'
run: yarn vitest scripts