-
Notifications
You must be signed in to change notification settings - Fork 17
188 lines (166 loc) · 6.95 KB
/
repo_tests.yaml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: repo_tests
on: [workflow_dispatch, workflow_call]
permissions: read-all
jobs:
repo_tests:
name: ${{ matrix.repo }} ${{ matrix.description }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Items in this list satisfy a few criteria:
#
# * test has to be useful/interesting and add value atop the monorepo tests for
# trunk init
#
# * the repo has to exercise some functionality specific to action.yaml (e.g. our
# custom Node functionality for npm/yarn/pnpm)
#
# * the repo and its dependency closure should be fast to set up, since we trigger
# this workflow on PRs
#
- repo: highlightjs/highlight.js
ref: 4f9cd3bffb6bc55c9e2c4252c7b733a219880151
description: (uses npm)
post-init: |
# terrascan scans dockerfile.js (a JS file for parsing dockerfiles) as a dockerfile itself
echo "src/languages/dockerfile.js" >> .gitignore
cp local-action/repo_tests/highlightjs.yaml .trunk/user.yaml
- repo: jbeder/yaml-cpp
ref: 0e6e28d1a38224fc8172fae0109ea7f673c096db
description: (compile-commands.json)
post-init: |
# black complains about py2 code
# markdownlint fails for some reason, and what we really care about anyways is clang-tidy
${TRUNK_PATH} check disable black markdownlint
mkdir build
cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cd ..
ln -s build/compile_commands.json
sed -i "s|lint:|lint:\n compile_commands: json|" .trunk/trunk.yaml
cp local-action/repo_tests/yaml_cpp.yaml .trunk/user.yaml
${TRUNK_PATH} check enable clang-tidy
- repo: pallets/flask
ref: 4bcd4be6b7d69521115ef695a379361732bcaea6
post-init: |
# prettier chokes on this malformed html file
echo "examples/celery/src/task_app/templates/index.html" >> .gitignore
cp local-action/repo_tests/flask.yaml .trunk/user.yaml
- repo: postcss/postcss
ref: aa9e03ea4708909631eba70500c8c0cc0708bb4e
description: (uses pnpm)
post-init: |
${TRUNK_PATH} check enable eslint
- repo: postcss/postcss
ref: aa9e03ea4708909631eba70500c8c0cc0708bb4e
description: (compat test for cli 1.0.0)
post-init: |
${TRUNK_PATH} check enable eslint
- repo: prawn-test-staging-rw/setup-node-test
ref: main
post-init: |
if [ "${FAILED_NODE_INSTALL}" != "true" ]; then
echo "::error::Initial setup node didn't fail"
exit 1
fi
description: (test for setup-node)
- repo: prawn-test-staging-rw/node-packages-failure-test
ref: main
post-init: |
if [ "${FAILED_NODE_PACKAGE_INSTALL}" != "true" ]; then
echo "::error::Node package install didn't fail"
exit 1
fi
if grep -q "✔ eslint" <(${TRUNK_PATH} check list --color=false); then
echo "::error::eslint not disabled"
exit 1
fi
if grep -q "✔ stylelint" <(${TRUNK_PATH} check list --color=false); then
echo "::error::stylelint not disabled"
exit 1
fi
description: (test for continuing on node package install failure)
- repo: replayio/devtools
ref: 730a9f0ddaafefc2a1a293d6924ce3910cd156ac
description: (has trunk.yaml)
post-init: |
# replay is on a very old version
# trunk upgrade requires 3 calls to guarantee correctness
${TRUNK_PATH} upgrade
${TRUNK_PATH} upgrade
${TRUNK_PATH} upgrade
trunk-path: node_modules/.bin/trunk
- repo: sass/sass
ref: 225e176115211387e014d97ae0076d94de3152a1
description: (uses npm)
- repo: sheldonhull/sheldonhull.hugo
ref: 0810b7219c6681931bbf727cd9fe81693b414b60
description: (has trunk.yaml)
post-init: |
# all of these linters have failures
${TRUNK_PATH} check disable svgo golangci-lint prettier oxipng
- repo: shopify/draggable
ref: e6cf325a98c11b8aefbfb626b7a91b95d1c340c9
description: (uses yarn)
- repo: terraform-linters/tflint
ref: 9c34a740319e2410094ca2754e5eca860f2d13f5
post-init: |
# golangci-lint needs us to init with a newer go runtime
${TRUNK_PATH} check disable golangci-lint
# tfsec and terrascan scan these malformed test files and error
echo "integrationtest/" >> .gitignore
echo "terraform/test-fixtures" >> .gitignore
- repo: trunk-io/plugins
ref: main
# fails because pnpm version is too new
# - repo: vuejs/core
# ref: 60cd23c7520f9098bf31fc2d0c09d58ded75f173
# description: (uses pnpm)
# post-init: |
# # svgo gets confused by JS module loading
# ${TRUNK_PATH} check disable svgo
- repo: z-shell/wiki
ref: d6d8b5da28c170b3b226705795412497f7059681
description: (has trunk.yaml)
post-init: |
# stylelint is exiting with error code -11
${TRUNK_PATH} check disable stylelint
steps:
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
with:
path: local-action
- name: Run trunk-action in ${{ matrix.repo }}
id: trunk
uses: ./local-action/
with:
cache: true
check-mode: all
trunk-path: ${{ matrix.trunk-path }}
post-init: ${{ matrix.post-init }}
arguments: --output-file=/tmp/landing-state.json
cache-key: repo_tests/${{ matrix.repo }}
setup-deps: true
env:
TRUNK_CLI_VERSION:
${{ matrix.description == '(compat test for cli 1.0.0)' && '1.0.0' || '' }}
continue-on-error: true
- name: Check for task failures
shell: bash
run: |
python3 local-action/repo_tests/check_for_task_failures.py \
'${{ github.env }}' \
'${{ matrix.repo }}' \
'${{ matrix.description }}'
- name: Upload landing state
uses: actions/upload-artifact@v4
with:
name: ${{ env.landing_state_artifact_name }} landing state
path: .trunk/landing-state.json