multi-scrobbler/.github/act/README.md
FoxxMD 1b0e7a3dfd ci: Make test workflow reusable and add run sanity check
* Add sanity run steps to check for obvious errors when running in production
* Refactor test job to be reusable
2024-10-10 12:05:16 -04:00

1.7 KiB

Testing GH Actions with ACT

Need to have credentials in a .secrets file, copy and rename .secrets.example to .secrets, then fill out blank fields. Required for docker/metadata-action to read...something. Fails with Parameter token or opts.auth is required if they are not supplied.

An ENV file can also be made by copy and renaming .env.example. Set NO_DOCKER_BUILD=true if you only want to test APP_VERSION and docker tags output.

If running a full docker build for multi-runner workflows you will need to create an artifact server for ACT to work:

docker pull ghcr.io/jefuller/artifact-server:latest
docker run -d --name artifact-server -p 8082:8080 --add-host host.docker.internal:host-gateway -e AUTH_KEY=foo ghcr.io/jefuller/artifact-server:latest

Run the following from this directory to make use of .actrc and proper working directory.

Test Branch Test Suite

act -W '.github/act/testSuite.yml' -e '.github/act/actBranchEvent.json'

Test Branch Push

act -W '.github/act/actTest.yml' -e '.github/act/actBranchEvent.json'

Test Tag (Release) Push

act -W '.github/act/actTest.yml' -e '.github/act/actTagEvent.json'

Test Tag (Pre-Release) Push

act -W '.github/act/actTest.yml' -e '.github/act/actTagPreEvent.json'

Test Multi-Runner Push (WIP)

act -W '.github/act/multiRunnerTest.yml' -e '.github/act/actBranchEvent.json'

Test Multi-Runner Bake Push (WIP)

act -W '.github/act/multiRunnerBakeTest.yml' -e '.github/act/actBranchEvent.json'