@@ -40,7 +40,7 @@ proficient in English.
4040
4141` make ` (3.81 or later) is useful to run each tasks and reduce redundant builds/tests.
4242
43- ## How to build
43+ ## Building
4444
4545``` sh
4646go build ./cmd/actionlint
@@ -62,7 +62,14 @@ make build SKIP_GO_GENERATE=1
6262Since actionlint doesn't use any cgo features, setting ` CGO_ENABLED=0 ` environment variable is recommended to avoid troubles
6363around linking libc. ` make build ` does this by default.
6464
65- ## How to run tests
65+ ## Testing
66+
67+ [ ![ CI] ( https://github.com/rhysd/actionlint/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/ci.yaml )
68+ [ ![ Generate] ( https://github.com/rhysd/actionlint/actions/workflows/generate.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/generate.yaml )
69+ [ ![ Problem Matchers] ( https://github.com/rhysd/actionlint/actions/workflows/matcher.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/matcher.yaml )
70+ [ ![ Download script] ( https://github.com/rhysd/actionlint/actions/workflows/download.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/download.yaml )
71+ [ ![ Release] ( https://github.com/rhysd/actionlint/actions/workflows/release.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/release.yaml )
72+ [ ![ Codecov] ( https://codecov.io/gh/rhysd/actionlint/graph/badge.svg?token=CgcOo0m9oW )] ( https://codecov.io/gh/rhysd/actionlint )
6673
6774Run the following command at the root of this repository.
6875
@@ -85,7 +92,22 @@ make cov
8592open coverage.html
8693```
8794
88- ## How to run lints
95+ Automated tests are as follows.
96+
97+ - Unit tests are implemented in ` *_test.go ` files for testing the corresponding APIs. Test data for unit tests are put in
98+ ` testdata/ ` directory.
99+ - UI tests based on matching to error messages are implemented in ` linter_test.go ` and all test data are stored in ` testdata/ `
100+ directory.
101+ - ` testdata/examples/ ` contains tests for all examples in [ 'Checks' document] ( docs/checks.md ) . ` *.yaml ` files are an input
102+ workflow and ` *.out ` files are expected error messages.
103+ - ` testdata/ok/ ` contains 'OK' tests. All workflow files in this directory should cause no errors.
104+ - ` testdata/err/ ` contains 'Error' tests. Each ` *.yaml ` files are workflow inputs and corresponding ` *.out ` files are expected
105+ error messages (one error per line).
106+ - ` testdata/projects/ ` contains 'Project' tests. Each directories represent a single project (meaning a repository on GitHub).
107+ Corresponding ` *.out ` files are expected error messages. Empty ` *.out ` file means the test case should cause no errors.
108+ 'Project' test is used for use cases where multiple files are related (reusable workflows, local actions, config files, ...).
109+
110+ ## Linting
89111
90112[ staticcheck] ( https://staticcheck.io/ ) is used to lint Go sources.
91113
@@ -105,7 +127,7 @@ These lints can be run with other checks by the following command.
105127make lint
106128```
107129
108- ## How to run fuzzer
130+ ## Fuzzing
109131
110132Fuzz tests use [ go-fuzz] ( https://github.com/dvyukov/go-fuzz ) . Install ` go-fuzz ` and ` go-fuzz-build ` in your system.
111133
125147make fuzz FUZZ_FUNC=FuzzParse
126148```
127149
128- ## How to release
150+ ## Make a new release
129151
130152When releasing v1.2.3 as example:
131153
@@ -239,30 +261,6 @@ See [the readme of the script](./scripts/generate-availability/README.md) for th
239261
240262Update for ` availability.go ` is run weekly on CI by [ ` generate ` ] ( .github/workflows/generate.yaml ) workflow.
241263
242- ## Testing
243-
244- [ ![ CI] ( https://github.com/rhysd/actionlint/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/ci.yaml )
245- [ ![ Generate] ( https://github.com/rhysd/actionlint/actions/workflows/generate.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/generate.yaml )
246- [ ![ Problem Matchers] ( https://github.com/rhysd/actionlint/actions/workflows/matcher.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/matcher.yaml )
247- [ ![ Download script] ( https://github.com/rhysd/actionlint/actions/workflows/download.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/download.yaml )
248- [ ![ Release] ( https://github.com/rhysd/actionlint/actions/workflows/release.yaml/badge.svg )] ( https://github.com/rhysd/actionlint/actions/workflows/release.yaml )
249- [ ![ Codecov] ( https://codecov.io/gh/rhysd/actionlint/graph/badge.svg?token=CgcOo0m9oW )] ( https://codecov.io/gh/rhysd/actionlint )
250-
251- All tests are automated.
252-
253- - Unit tests are implemented in ` *_test.go ` files for testing the corresponding APIs. Test data for unit tests are put in
254- ` testdata/ ` directory.
255- - UI tests based on matching to error messages are implemented in ` linter_test.go ` and all test data are stored in ` testdata/ `
256- directory.
257- - ` testdata/examples/ ` contains tests for all examples in [ 'Checks' document] ( docs/checks.md ) . ` *.yaml ` files are an input
258- workflow and ` *.out ` files are expected error messages.
259- - ` testdata/ok/ ` contains 'OK' tests. All workflow files in this directory should cause no errors.
260- - ` testdata/err/ ` contains 'Error' tests. Each ` *.yaml ` files are workflow inputs and corresponding ` *.out ` files are expected
261- error messages (one error per line).
262- - ` testdata/projects/ ` contains 'Project' tests. Each directories represent a single project (meaning a repository on GitHub).
263- Corresponding ` *.out ` files are expected error messages. Empty ` *.out ` file means the test case should cause no errors.
264- 'Project' test is used for use cases where multiple files are related (reusable workflows, local actions, config files, ...).
265-
266264<a id =" about-checks-doc " ></a >
267265## How to write checks document
268266
0 commit comments