-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (79 loc) · 2.84 KB
/
ci.yml
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
name: CI
on:
pull_request:
workflow_call:
workflow_dispatch:
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
ci:
name: Detect affected packages, build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
node-version-file: '.nvmrc'
- uses: wagoid/commitlint-github-action@v5
- name: Debug info
run: |
cat <<EOF
Scratch environment: ${{ vars.SCRATCH_ENV || '<none>' }}
Node version: $(node --version)
NPM version: $(npm --version)
GitHub ref: ${{ github.ref }}
GitHub head ref: ${{ github.head_ref }}
Working directory: $(pwd)
EOF
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
any-workspace:
- ".github/workflows/ci.yml"
- "packages/**"
scratch-svg-renderer:
- ".github/workflows/ci.yml"
- "packages/scratch-svg-renderer/**"
scratch-render:
- ".github/workflows/ci.yml"
- "packages/scratch-render/**"
- "packages/scratch-svg-renderer/**"
scratch-vm:
- ".github/workflows/ci.yml"
- "packages/scratch-render/**"
- "packages/scratch-svg-renderer/**"
- "packages/scratch-vm/**"
scratch-gui:
- ".github/workflows/ci.yml"
- "packages/scratch-gui/**"
- "packages/scratch-render/**"
- "packages/scratch-svg-renderer/**"
- "packages/scratch-vm/**"
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
uses: ./.github/actions/install-dependencies
- name: Build packages
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
run: npm run build
- name: Test scratch-svg-renderer
if: ${{ !cancelled() && steps.filter.outputs.scratch-svg-renderer == 'true' }}
uses: ./.github/actions/test-package
with:
package_name: scratch-svg-renderer
- name: Test scratch-render
if: ${{ !cancelled() && steps.filter.outputs.scratch-render == 'true' }}
uses: ./.github/actions/test-package
with:
package_name: scratch-render
- name: Test scratch-vm
if: ${{ !cancelled() && steps.filter.outputs.scratch-vm == 'true' }}
uses: ./.github/actions/test-package
with:
package_name: scratch-vm
- name: Test scratch-gui
if: ${{ !cancelled() && steps.filter.outputs.scratch-gui == 'true' }}
uses: ./.github/actions/test-package
with:
package_name: scratch-gui