1
1
# Copyright 2023 Google LLC
2
+ # Copyright 2024 Ian Lewis
2
3
#
3
4
# Licensed under the Apache License, Version 2.0 (the "License");
4
5
# you may not use this file except in compliance with the License.
36
37
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
37
38
- uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
38
39
with :
39
- node-version : 20
40
+ node-version-file : " package.json "
40
41
- name : unit tests
41
42
run : |
42
43
make unit-test
57
58
58
59
- uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
59
60
with :
60
- node-version : 20
61
+ node-version-file : " package.json "
61
62
62
63
- name : Rebuild the dist/ directory
63
64
run : make clean package
@@ -81,29 +82,49 @@ jobs:
81
82
name : dist
82
83
path : dist/
83
84
84
- # autogen for license headers
85
+ # Check license headers
85
86
# ##############################
86
-
87
- autogen :
87
+ license-headers :
88
88
runs-on : ubuntu-latest
89
89
steps :
90
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
91
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
90
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
92
92
with :
93
93
repository : mbrukman/autogen
94
94
ref : 9026b78e17573b5dda4bff79033c352443551dc5
95
95
path : autogen
96
96
- run : |
97
97
echo "${GITHUB_WORKSPACE}/autogen" >> "${GITHUB_PATH}"
98
- - run : make autogen
98
+ - run : |
99
+ git config user.name "Unknown"
100
+ make license-headers
99
101
- name : check diff
100
102
run : |
101
103
set -euo pipefail
102
104
if [ "$(GIT_PAGER="cat" git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
103
- echo "::error::Detected license header changes. See status below:"
104
- echo "::group::git diff"
105
+ echo "Detected license header changes. See status below:"
106
+ GIT_PAGER="cat" git diff
107
+ exit 1
108
+ fi
109
+
110
+ # formatting
111
+ # ##############################
112
+
113
+ formatting :
114
+ runs-on : ubuntu-latest
115
+ steps :
116
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
117
+ - uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
118
+ with :
119
+ node-version-file : " package.json"
120
+ - run : |
121
+ make format
122
+ - name : check diff
123
+ run : |
124
+ set -euo pipefail
125
+ if [ "$(GIT_PAGER="cat" git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
126
+ echo "Detected formatting changes. See status below:"
105
127
GIT_PAGER="cat" git diff
106
- echo "::endgroup::"
107
128
exit 1
108
129
fi
109
130
@@ -113,32 +134,30 @@ jobs:
113
134
actionlint :
114
135
runs-on : ubuntu-latest
115
136
steps :
116
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
137
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
117
138
- name : actionlint
118
139
env :
119
- SHELLCHECK_VERSION : " 0.9 .0"
120
- SHELLCHECK_CHECKSUM : " 700324c6dd0ebea0117591c6cc9d7350d9c7c5c287acbad7630fa17b1d4d9e2f "
121
- ACTIONLINT_VERSION : " 1.6.26 "
122
- ACTIONLINT_CHECKSUM : " f0294c342af98fad4ff917bc32032f28e1b55f76aedf291886ec10bbed7c12e1 "
140
+ SHELLCHECK_VERSION : " 0.10 .0"
141
+ SHELLCHECK_CHECKSUM : " 6c881ab0698e4e6ea235245f22832860544f17ba386442fe7e9d629f8cbedf87 "
142
+ ACTIONLINT_VERSION : " 1.7.3 "
143
+ ACTIONLINT_CHECKSUM : " 37252b4d440b56374b0fc1726e05fd7452d30d6d774f6e9b52e65bb64475f9db "
123
144
run : |
124
145
set -euo pipefail
125
146
126
147
# Install shellcheck
127
148
curl -sSLo shellcheck.tar.gz "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
128
- if ! echo "${SHELLCHECK_CHECKSUM} shellcheck.tar.gz" | sha256sum --strict --check --status; then
129
- echo "::error::Unexpected checksum for shellcheck: expected '${SHELLCHECK_CHECKSUM}', got '$(sha256sum shellcheck.tar.gz | awk '{ print $1 }')'"
130
- exit 1
131
- fi
149
+ echo "shellcheck checksum is $(sha256sum shellcheck.tar.gz | awk '{ print $1 }')"
150
+ echo "expected checksum is $SHELLCHECK_CHECKSUM"
151
+ echo "$SHELLCHECK_CHECKSUM shellcheck.tar.gz" | sha256sum --strict --check --status || exit 1
132
152
133
153
tar xf shellcheck.tar.gz
134
154
mv "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/local/bin
135
155
136
156
# Install actionlint
137
157
curl -sSLo actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
138
- if ! echo "${ACTIONLINT_CHECKSUM} actionlint.tar.gz" | sha256sum --strict --check --status; then
139
- echo "::error::Unexpected checksum for actionlint: expected '${ACTIONLINT_CHECKSUM}', got '$(sha256sum actionlint.tar.gz | awk '{ print $1 }')'"
140
- exit 1
141
- fi
158
+ echo "actionlint checksum is $(sha256sum actionlint.tar.gz | awk '{ print $1 }')"
159
+ echo "expected checksum is $ACTIONLINT_CHECKSUM"
160
+ echo "$ACTIONLINT_CHECKSUM actionlint.tar.gz" | sha256sum --strict --check --status || exit 1
142
161
143
162
tar xf actionlint.tar.gz
144
163
mv ./actionlint /usr/local/bin
@@ -148,34 +167,25 @@ jobs:
148
167
markdownlint :
149
168
runs-on : ubuntu-latest
150
169
steps :
151
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
152
- - uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
170
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
171
+ - uses : actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
153
172
with :
154
- node-version : 20
173
+ node-version-file : " package.json "
155
174
- run : make markdownlint
156
175
157
176
yamllint :
158
177
runs-on : ubuntu-latest
159
178
steps :
160
- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
161
- - env :
162
- YAMLLINT_VERSION : " 1.26.3"
163
- run : |
164
- set -euo pipefail
165
-
166
- # Install yamllint
167
- pip install -r requirements.txt --require-hashes
168
-
169
- # Run yamllint
170
- make yamllint
179
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
180
+ - run : make yamllint
171
181
172
182
eslint :
173
183
runs-on : ubuntu-latest
174
184
steps :
175
185
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
176
186
- uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
177
187
with :
178
- node-version : 20
188
+ node-version-file : " package.json "
179
189
- run : make eslint
180
190
181
191
# e2e tests.
0 commit comments