-
Notifications
You must be signed in to change notification settings - Fork 16
139 lines (119 loc) · 5.34 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
name: repo_tests
on: [workflow_dispatch, workflow_call]
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: |
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
${TRUNK_PATH} check disable black
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
# fails because of a malformed html file
# - repo: pallets/flask
# ref: 2b2a7641430bc7d40dba3c8d701636fc9b16530c
# post-init: |
# 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: replayio/devtools
ref: 730a9f0ddaafefc2a1a293d6924ce3910cd156ac
description: (has trunk.yaml)
post-init: |
# replay is on a very old version
${TRUNK_PATH} upgrade
trunk-path: node_modules/.bin/trunk
- repo: sass/sass
ref: 225e176115211387e014d97ae0076d94de3152a1
description: (uses npm)
# fails because yarn install would update the yarn lockfile
# - repo: sheldonhull/sheldonhull.hugo
# ref: 4796211f1adeeb1858f2f9bf74d7ee0b4e2d8988
# description: (has trunk.yaml)
- 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
- repo: trunk-io/plugins
ref: main
# fails because pnpm version is too new
# - repo: vuejs/core
# ref: 2d9f6f926453c46f542789927bcd30d15da9c24b
# description: (uses pnpm)
# post-init: |
# # svgo gets confused by JS module loading
# ${TRUNK_PATH} check disable svgo
- repo: z-shell/wiki
ref: 7d0ea1b14d2f163d54111655aa9aa737f3710b72
description: (has trunk.yaml)
steps:
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v3
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=.trunk/landing-state.json
cache-key: repo_tests/${{ matrix.repo }}
setup-deps: true
json: '{"targetCheckoutRef":"refs/pull/9042/merge","targetRefName":"9042/merge","checkMode":"pull_request","token":"fake-trunk-token","pullRequest":{"number":9042,"head":{"sha":"4e54c7d493b70adf4e4f3fd0188e0ffa5dc58ec2","ref":"elton/fix"},"base":{"sha":"b0fda5a68784996673bd6256085f02ae4dd75c51","ref":"elton/transitions"}},"checkRunId":13970097585,"version":"0.0.0","cache":true,"cacheKey":"trunk-check","cachePath":"~/.cache/trunk/tools/ruby","checkJobName":"trunk/pull_request","checkJobRunsOn":["self-hosted","linux","r6id2xlarge"],"concurrencyGroup":"trunk/pull_request/9042","githubToken":"fake-github-token","targetCheckout":"trunk-io/trunk","uploadLandingState":true}'
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@v3
with:
name: ${{ env.landing_state_artifact_name }} landing state
path: .trunk/landing-state.json