-
Notifications
You must be signed in to change notification settings - Fork 6
65 lines (54 loc) · 2.16 KB
/
Copy pathmain.yml
File metadata and controls
65 lines (54 loc) · 2.16 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
64
65
name: Validate
on: push
# Cancel superseded runs on the same ref (same behavior as the former cleanup job: skip for master and tags).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' }}
jobs:
test:
name: "Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Node.JS
uses: actions/setup-node@v6
with:
node-version-file: ".node-version"
cache: yarn
# Lockfile is Yarn v1; runners may ship a newer global Yarn.
- name: Use Yarn classic
run: npm install -g yarn@1.22.22
- name: Install Javascript dependencies
run: yarn install
# LS: When we upgrade to Yarn 2, we can just have the `yarn install --immutable` command. But with Yarn 1 it does nothing.
- name: Verify that committed yarn.lock is up to date
run: |
git diff --exit-code --quiet HEAD -- yarn.lock || { echo 'Run yarn and commit changes to yarn.lock!'; false; }
- name: Test
run: |
yarn workspaces run test
- name: Validate all actions distributives are up to date
run: |
yarn workspaces run prepublish
git diff --exit-code --quiet HEAD || { echo 'Run "yarn workspaces run prepublish" and commit changes!'; false; }
- name: Save git diff
if: ${{ failure() }}
run: mkdir tmp && git diff > tmp/diff
- name: Upload git diff
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: diff_failed
path: tmp/
- name: Notify unsuccessful build
uses: 8398a7/action-slack@v3.19.0
with:
status: ${{ job.status }}
author_name: GA Deployer
fields: repo,author,message
mention: here
if_mention: failure,cancelled
text: ":fire:BWEEP bip bip BWEEP:fire: *${{ github.job }} ${{ job.status }}* in the '${{ github.workflow }}' workflow"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure() && github.ref == 'refs/heads/master'