-
Notifications
You must be signed in to change notification settings - Fork 16
131 lines (111 loc) · 3.28 KB
/
checks.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI Checks
on:
push:
branches:
- main
pull_request:
jobs:
formatting:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install shfmt
run: sudo snap install --classic shfmt
- name: Format shell scripts
run: ./scripts/fmt-sh
- name: Install ts dependencies
run: npm ci
- name: Format ts
run: npm run format
- name: Commit Formatting changes - will not trigger rebuild
uses: EndBug/[email protected]
if: ${{ github.event_name == 'pull_request' }}
with:
add: .
author_name: Formatting Committer
author_email: "<[email protected]>"
message: "Updating formatting"
# do not pull: if this branch is behind, then we might as well let
# the pushing fail
pull_strategy: "NO-PULL"
build-candid:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install didc
run: |
mkdir -p .bin
curl -L https://github.com/dfinity/candid/releases/download/2022-08-09/didc-linux64 > .bin/didc
chmod +x .bin/didc
- name: Add didc to the PATH
run: echo "${PWD}/.bin" >> $GITHUB_PATH
- name: Install ts dependencies
run: npm ci --include=dev
- name: Compile candid
run: ./scripts/compile-idl-js
- name: Verify that there are no changes to the compiled did files
run: git diff --exit-code -- candid/
build-protobuf:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check the protoc installer
run: ./scripts/install-protoc --help
- name: Install protoc
run: sudo ./scripts/install-protoc
- name: Install ts dependencies
run: npm ci --include=dev
- name: Compile protobuf
run: npm run protoc
- name: Verify that there are no changes to the compiled proto files
run: git diff --exit-code -- packages/nns/proto/
build:
needs: [build-candid, build-protobuf]
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build --workspaces
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build --workspaces
- name: Test
run: npm run test --workspaces
size:
runs-on: ubuntu-20.04
# The size checker should run and provide metrics only on PRs
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Size check
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
may-merge:
needs: ["formatting", "build", "lint", "test", "size"]
runs-on: ubuntu-20.04
steps:
- name: Cleared for merging
run: echo OK