- Install Act
- Scoop:
- Scoop
- Install act:
scoop install act
- winget:
- winget install nektos.act
- Install Docker Desktop, or Rancher Desktop if you can't install Docker Desktop due to the change in licensing
- If installing Rancher, ensure that you choose
dockerd
not containerd
- Install WSL2 support if you don't have it: Install WSL2
- This is very simple on newer windows builds:
wsl --install
in a powershell shell.
- Suggest using the
Ubuntu
image when it asks.
- Notes: ensure that you have hardware virtualisation on in your bios and that your WSL system is set to default to version 2!
- Now we need a repo to test against, so choose one of your repos and add a .github/workflows directory tree to the root of the project.
- Create a workflow yaml file in that folder e.g.
build.yaml
- Add some initial content to your file e.g.
name: TestCI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch and tags
on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- Commit and push the changes.
- Open the root of your project in powershell and type
act
- Select an image for act to use. Suggested is
Medium
- Wait while act pulls down the required docker image
- If successful you should see something like this:
[TestCI/build] 🚀 Start image=catthehacker/ubuntu:act-latest
[TestCI/build] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[TestCI/build] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[TestCI/build] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[TestCI/build] ⭐ Run Main Checkout
[TestCI/build] 🐳 docker cp src=C:\temp\act-test\. dst=/mnt/c/temp/act-test
[TestCI/build] ✅ Success - Main Checkout
[TestCI/build] 🏁 Job succeeded
- Act developement and updates are frequent. To update
scoop update act
. You may want to update scoop every now and then as well: scoop update