You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some files are generated by scripts in [`scripts/`](./scripts) directory. These files are kept up-to-date by CI workflows.
150
149
151
-
The script also can detect new releases of popular actions on GitHub by giving `-d` flag.
150
+
### Maintain `popular_actions.go`
152
151
153
-
Detecting new release and updating `popular_actions.go` are run weekly on CI by [`generate`](.github/workflows/generate.yaml)
154
-
workflow. Runs can be checked [here](https://github.com/rhysd/actionlint/actions/workflows/generate.yaml).
152
+
[`popular_actions.go`](./popular_actions.go) is a data set of metadata of popular actions hosted on GitHub. It is generated
153
+
automatically with `go generate`. The command runs [`generate-popular-actions`](./scripts/generate-popular-actions) script.
155
154
156
-
## Maintain `all_webhooks.go`
155
+
The script also can detect new major releases of popular actions on GitHub by giving `-d` flag.
156
+
157
+
The [`generate`](.github/workflows/generate.yaml) CI workflow weekly runs to detect new major releases and update
158
+
`popular_actions.go`. Runs can be found [here](https://github.com/rhysd/actionlint/actions/workflows/generate.yaml).
159
+
160
+
### Maintain `all_webhooks.go`
157
161
158
162
[`all_webhooks.go`](./all_webhooks.go) is a table all webhooks supported by GitHub Actions to trigger workflows. Note that
159
163
not all webhooks are supported by GitHub Actions.
160
164
161
-
It is generated automatically with `go generate`. The command runs [`generate-webhook-events`](./scripts/generate-webhook-events)
162
-
script.
165
+
It is generated automatically with `go generate` running [`generate-webhook-events`](./scripts/generate-webhook-events) script.
163
166
164
167
It fetches [`events-that-trigger-workflows.md`](https://github.com/github/docs/blob/main/content/actions/learn-github-actions/events-that-trigger-workflows.md),
165
168
parses the markdown document, and extracts webhook names and their types. For more details, see
166
-
[README.md at the script](./scripts/generate-webhook-events/README.md).
169
+
[README.md at the script directory](./scripts/generate-webhook-events/README.md).
167
170
168
171
Updating `all_webhooks.go` is run weekly on CI by [`generate`](.github/workflows/generate.yaml) workflow.
169
172
170
-
## Maintain `actionlint-matcher.json`
173
+
###Maintain `actionlint-matcher.json`
171
174
172
175
[`actionlint-matcher.json`](.github/actionlint-matcher.json) is a matcher configuration to extract error annotations from outputs
173
176
of `actionlint` command. See [the document](docs/usage.md#problem-matchers) for its usage.
@@ -178,7 +181,7 @@ file is not modified manually.
178
181
It is generated by [`generate-actionlint-matcher`](./scripts/generate-actionlint-matcher) script. See the README.md file for the
179
182
usage of the script and how to run the tests for it.
180
183
181
-
## Maintain `availability.go`
184
+
###Maintain `availability.go`
182
185
183
186
[`availability.go`](./availability.go) is a table for conversion from workflow key (like `jobs.<job_id>.if`) to availability of
184
187
contexts and special functions. GitHub Actions limits contexts and functions in certain places. For example:
@@ -194,8 +197,17 @@ Update for `availability.go` is run weekly on CI by [`generate`](.github/workflo
194
197
195
198
## Testing
196
199
197
-
- All examples in ['Checks' document](docs/checks.md) are put in [the examples directory](testdata/examples) and tested in
198
-
[`linter_test.go`](linter_test.go).
199
-
- I cloned GitHub top 1000 repositories and extracted 1400+ workflow files. And I tried actionlint with the collected workflow
200
-
files. All bugs found while the trial were fixed and I confirmed no more false positives.
201
-
200
+
All tests are automated.
201
+
202
+
- Unit tests are implemented in `*_test.go` files for testing the corresponding APIs. Test data for unit tests are put in
203
+
`testdata/` directory.
204
+
- UI tests based on matching to error messages are implemented in `linter_test.go` and all test data are stored in `testdata/`
205
+
directory.
206
+
-`testdata/examples/` contains tests for all examples in ['Checks' document](docs/checks.md). `*.yaml` files are an input
207
+
workflow and `*.out` files are expected error messages.
208
+
-`testdata/ok/` contains 'OK' tests. All workflow files in this directory should cause no errors.
209
+
-`testdata/err/` contains 'Error' tests. Each `*.yaml` files are workflow inputs and corresponding `*.out` files are expected
210
+
error messages (one error per line).
211
+
-`testdata/projects/` contains 'Project' tests. Each directories represent a single project (meaning a repository on GitHub).
212
+
Corresponding `*.out` files are expected error messages. Empty `*.out` file means the test case should cause no errors.
213
+
'Project' test is used for use cases where multiple files are related (reusable workflows, local actions, config files, ...).
0 commit comments