Skip to content

Commit

Permalink
Add script for running GitHub Actions pipeline locally using the act …
Browse files Browse the repository at this point in the history
…tool
  • Loading branch information
samuell committed Jan 26, 2024
1 parent 81ff483 commit f13e238
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
#- "-profile klebsiella_pneumoniae"
#- "-profile escherichia_coli"
steps:
- name: Install Java
if: "${{ github.event.act }}"
run: |
apt-get update && sudo apt-get install -y openjdk-21-jre
- name: Check out pipeline code
uses: actions/checkout@v3

Expand Down
14 changes: 14 additions & 0 deletions scripts/runci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# This script uses the act tool to execute GitHub Actions workflows locally
# for increased iteration speed.
# It requires the act [1] binary to be available in your path.
# It also requires a late version of the GitHub commandline client (`gh`) [2]
# to be installed and available on your path.
# [1] https://github.com/nektos/act
# [2] https://github.com/cli/cli
act -v \
-s GITHUB_TOKEN="$(gh auth token)" \
-e event.json \
-P ubuntu-latest=catthehacker/ubuntu:act-latest \
-W .github/workflows/ci.yml \
|& tee ci-output-$(date +%Y%m%d.%H%M%S).log

0 comments on commit f13e238

Please sign in to comment.