Skip to content

Commit 8b836a1

Browse files
Update CONTRIBUTING.md with instructions for local run
1 parent 7bd6716 commit 8b836a1

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,40 @@ A good patch is:
5656
3. Documented, adding API documentation as needed to cover new functions and properties.
5757
4. Accompanied by a great commit message, using our commit message template.
5858

59-
### Run `./scripts/soundness.sh`
59+
### Run CI checks locally
6060

61-
The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-openapi-runtime/blob/main/scripts/soundness.sh)
62-
that enforces additional checks, like license headers and formatting style.
61+
You can run the Github Actions workflows locally using
62+
[act](https://github.com/nektos/act). To run all the jobs that run on a pull
63+
request, use the following command:
6364

64-
Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
65-
on minor changes such as a missing `self.` or similar formatting issues.
65+
```
66+
% act pull_request
67+
```
6668

67-
For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory:
69+
To run just a single job, use `workflow_call -j <job>`, and specify the inputs
70+
the job expects. For example, to run just shellcheck:
71+
72+
```
73+
% act workflow_call -j soundness --input shell_check_enabled=true
74+
```
6875

69-
```bash
70-
cat << EOF > .git/hooks/pre-push
76+
To bind-mount the working directory to the container, rather than a copy, use
77+
`--bind`. For example, to run just the formatting, and have the results
78+
reflected in your working directory:
7179

72-
if [[ -f "scripts/soundness.sh" ]]; then
73-
scripts/soundness.sh
74-
fi
75-
EOF
80+
```
81+
% act --bind workflow_call -j soundness --input format_check_enabled=true
7682
```
7783

78-
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
84+
If you'd like `act` to always run with certain flags, these can be be placed in
85+
an `.actrc` file either in the current working directory or your home
86+
directory, for example:
7987

80-
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
88+
```
89+
--container-architecture=linux/amd64
90+
--remote-name upstream
91+
--action-offline-mode
92+
```
8193

8294
## How to contribute your work
8395

0 commit comments

Comments
 (0)