Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: added GH Action Readme that explains how to run GH actions locally #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
GitHub Actions Notes
====================

Local Builds
---------------
You can locally test the GitHub Actions defined in this directory using [nektos act](https://github.com/nektos/act).

This allows you to run an equivalent CI build on your local machine. For example:
```console
$ act
```
Note: The first time you run [act](https://github.com/nektos/act), it can take a long time (with no output) to download
the various docker goodies. Give it time before deciding it is stuck.

To get a list of available jobs, run:
```console
$ act -l
```
To run a specific job, use the `-j` flag:
```console
$ act -j <job-name>
```
For example, to run the `build` job from the `ci.yml` file, use this command:
```console
$ act --workflows .github/workflows/ci.yml -j build
```
If running on Apple silicon, and you see docker errors, try launching act with this flag:
```console
act --container-architecture linux/amd64
```
Without this flag, I saw this warning:
```console
WARN ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
```
and this error:
```console
... 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1] user= workdir=
| docker compose build
[+] Building 0.0s (0/0)
| permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied
...
```