Run your GitHub Actions locally!
Homebrew (Linux/macOS)
brew install act
or if you want to install version based on latest commit, you can run below (it requires compiler to be installed installed but Homebrew will suggest you how to install it, if you don't have it):
brew install act --HEAD
MacPorts (macOS)
install MacPorts before execute below check port:
port --version
install act:
sudo port install act
Nix (Linux/macOS)
Install Nix:
sh <(curl -L https://nixos.org/nix/install) --daemon
Global install:
nix-env -iA nixpkgs.act
or through nix-shell
:
nix-shell -p act
Using the latest Nix command, you can run directly :
nix run nixpkgs#act
Docker (macOS)
Install Docker
brew install --cask docker
Check Docker
docker ps
- Create a .github/workflows directory in your repository on GitHub if this directory does not already exist.
- In the .github/workflows directory, create a file named github-actions-demo.yml. For more information, see "Creating new files."
- Copy the following YAML contents into the github-actions-demo.yml file:
name: GitHub Actions Demo
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "π₯οΈ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "π This job's status is ${{ job.status }}."
act
Free Software, Hell Yeah!