-
Notifications
You must be signed in to change notification settings - Fork 994
66 lines (56 loc) · 2.27 KB
/
check-test-project-fixture.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
name: Check test project fixture
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
# Cancel in-progress runs of this workflow.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-test-project-fixture:
name: Check test project fixture
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: 🐈 Set up yarn cache
if: "!contains(github.event.pull_request.labels.*.name, 'fixture-ok')"
uses: ./.github/actions/set-up-yarn-cache
- name: 🐈 Yarn install
if: "!contains(github.event.pull_request.labels.*.name, 'fixture-ok')"
run: yarn install --inline-builds
env:
GITHUB_TOKEN: ${{ github.token }}
- name: 🔨 Build
if: "!contains(github.event.pull_request.labels.*.name, 'fixture-ok')"
run: yarn build
- name: Rebuild test-project fixture
if: "!contains(github.event.pull_request.labels.*.name, 'fixture-ok')"
run: yarn rebuild-test-project-fixture
env:
REDWOOD_DISABLE_TELEMETRY: 1
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Check for changed files
if: "!contains(github.event.pull_request.labels.*.name, 'fixture-ok')"
run: |
if [ $(git status --porcelain | wc -l) -gt 0 ]; then
echo 'Updating the test project fixture caused files to change'
echo 'Please run `yarn rebuild-test-project-fixture` locally and commit any changes'
echo
echo 'Deleted files:'
git status --porcelain | grep '^ D ' | awk '{print " " $2}'
echo
echo 'Modified files:'
git status --porcelain | grep '^ M ' | awk '{print " " $2}'
echo
echo 'Untracked files:'
git status --porcelain | grep '^?? ' | awk '{print " " $2}'
echo
exit 1;
fi