Skip to content

Commit

Permalink
Merge act
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX committed Oct 6, 2021
2 parents fd9f40c + 6353546 commit 4c69291
Show file tree
Hide file tree
Showing 31 changed files with 1,010 additions and 235 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
58 changes: 35 additions & 23 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: checks
on: [push, pull_request, workflow_dispatch]
on: [pull_request, workflow_dispatch]

env:
ACT_OWNER: ${{ github.repository_owner }}
ACT_REPOSITORY: ${{ github.repository }}
CACHED_DOCKER_IMAGES: '"node:12-buster" "node:12-buster-slim" "ubuntu:18.04" "ubuntu:latest" "alpine:3.10" "tonistiigi/binfmt:latest"'
CACHED_DOCKER_IMAGES_KEY: docker-images-0
GO_VERSION: 1.17

jobs:
lint:
name: lint
Expand All @@ -11,9 +16,9 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: ${{ env.GO_VERSION }}
- uses: golangci/golangci-lint-action@v2
env:
CGO_ENABLED: 0
Expand Down Expand Up @@ -41,9 +46,9 @@ jobs:
fetch-depth: 2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
Expand All @@ -55,7 +60,7 @@ jobs:
env:
CGO_ENABLED: 0
- name: Upload Codecov report
uses: codecov/codecov-action@v1.5.2
uses: codecov/codecov-action@v2.1.0
with:
files: coverage.txt
fail_ci_if_error: true # optional (default = false)
Expand All @@ -66,7 +71,7 @@ jobs:
- uses: actions/cache@v2
id: image_cache
with:
key: docker-images-10
key: ${{ env.CACHED_DOCKER_IMAGES_KEY }}
path: |
registry
docker-registry
Expand All @@ -76,14 +81,14 @@ jobs:
docker pull registry:2
docker image save -o registry registry:2
mkdir -p docker-registry
docker run -d -p 5000:5000 --name registry -v $PWD/docker-registry:/var/lib/registry registry:2 ./entrypoint.sh /etc/docker/registry/config.yml
docker run -d -p 5000:5000 --name registry -v $PWD/docker-registry:/var/lib/registry registry:2
npx wait-on tcp:5000
for image in "node:12-buster" "node:12-buster-slim" "ubuntu:18.04" "alpine:3.10" "tonistiigi/binfmt:latest"
for image in ${{ env.CACHED_DOCKER_IMAGES }}
do
docker pull "$image"
docker tag "$image" "localhost:5000/$image"
docker push "localhost:5000/$image"
bash -c 'docker pull "'"$image"'" && docker tag "'"$image"'" "localhost:5000/'"$image"'" && docker push "localhost:5000/'"$image"'"'&
done
wait
test-macos:
needs: dump_images
name: test-macos
Expand All @@ -93,17 +98,18 @@ jobs:
ISO_PATH: ~/.docker/machine/cache/boot2docker.iso
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- name: Restore Docker Image Cache
uses: actions/cache@v2
id: image_cache
continue-on-error: true
with:
key: docker-images-10
key: ${{ env.CACHED_DOCKER_IMAGES_KEY }}
path: |
registry
docker-registry
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
Expand Down Expand Up @@ -140,13 +146,13 @@ jobs:
echo load registry
docker image load -i registry
echo Setup local registry
docker run -d -p 5000:5000 --name registry -v $PWD/docker-registry:/var/lib/registry registry:2 ./entrypoint.sh /etc/docker/registry/config.yml
docker run -d -p 5000:5000 --name registry -v $PWD/docker-registry:/var/lib/registry registry:2
echo pulling images from cache
for image in "node:12-buster" "node:12-buster-slim" "ubuntu:18.04" "alpine:3.10" "tonistiigi/binfmt:latest"
for image in ${{ env.CACHED_DOCKER_IMAGES }}
do
docker pull "localhost:5000/$image" || sleep 1 && docker pull "localhost:5000/$image" || sleep 2 && docker pull "localhost:5000/$image"
docker tag "localhost:5000/$image" "$image"
bash -c '(sleep 1 && docker pull "localhost:5000/'"$image"'" || sleep 2 && docker pull "localhost:5000/'"$image"'" || sleep 10 && docker pull "localhost:5000/'"$image"'") && docker tag "localhost:5000/'"$image"'" "'"$image"'"'&
done
wait
- name: 🛠️ Install Qemu for running containers with different architecture 🛠️
run: docker run --rm --privileged tonistiigi/binfmt:latest --install all
- run: go test -v -timeout 30m -cover ./...
Expand All @@ -158,9 +164,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
Expand All @@ -171,7 +177,7 @@ jobs:
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
version: v0.179.0
args: release --snapshot --rm-dist
- name: Capture x86_64 (64-bit) Linux binary
if: ${{ !env.ACT }}
Expand Down Expand Up @@ -215,6 +221,12 @@ jobs:
with:
name: act-windows-i386
path: dist/act_windows_386/act.exe
- name: Capture arm64 (64-bit) Windows binary
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
with:
name: act-windows-arm64
path: dist/act_windows_arm64/act.exe
- name: Capture armv7 (32-bit) Windows binary
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
tags:
- v*

env:
GO_VERSION: 1.17

jobs:
release:
name: release
Expand All @@ -12,9 +15,9 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
Expand All @@ -25,7 +28,7 @@ jobs:
- name: GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
version: v0.179.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Stale
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Issue is stale and will be closed in 14 days unless there is new activity'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ coverage.txt

.env
.secrets

# ignore docker registry from .github/workflows/checks.yml
docker-registry/
8 changes: 7 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ pull_request_rules:
- conflict
- name: warn on needs-work
conditions:
- '#check-failure>=1'
- or:
- check-failure=lint
- check-failure=test-linux
- check-failure=test-macos
- check-failure=codecov/patch
- check-failure=codecov/project
- check-failure=snapshot
actions:
comment:
message: '@{{author}} this pull request has failed checks 🛠'
Expand Down
12 changes: 4 additions & 8 deletions IMAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

**Note 2: `node` `-slim` images don't have `python` installed, if you want to use actions or software that is depending on `python`, you need to specify image manually**

| Image | Size |
| ------------------------------------ | -------------------------------------------------------- |
| [`node:12-buster`][hub/_/node] | ![`buster-size`][hub/_/node/12-buster/size] |
| [`node:12-buster-slim`][hub/_/node] | ![`micro-buster-size`][hub/_/node/12-buster-slim/size] |
| [`node:12-stretch`][hub/_/node] | ![`stretch-size`][hub/_/node/12-stretch/size] |
| [`node:12-stretch-slim`][hub/_/node] | ![`micro-stretch-size`][hub/_/node/12-stretch-slim/size] |
| Image | Size |
| ----------------------------------- | ------------------------------------------------------ |
| [`node:12-buster`][hub/_/node] | ![`buster-size`][hub/_/node/12-buster/size] |
| [`node:12-buster-slim`][hub/_/node] | ![`micro-buster-size`][hub/_/node/12-buster-slim/size] |

**Note: `catthehacker/ubuntu` images are based on Ubuntu root filesystem**

Expand Down Expand Up @@ -46,8 +44,6 @@ Feel free to make a pull request with your image added here
[hub/_/node]: https://hub.docker.com/r/_/node
[hub/_/node/12-buster/size]: https://img.shields.io/docker/image-size/_/node/12-buster
[hub/_/node/12-buster-slim/size]: https://img.shields.io/docker/image-size/_/node/12-buster-slim
[hub/_/node/12-stretch/size]: https://img.shields.io/docker/image-size/_/node/12-stretch
[hub/_/node/12-stretch-slim/size]: https://img.shields.io/docker/image-size/_/node/12-stretch-slim
[ghcr/catthehacker/ubuntu]: https://github.com/catthehacker/docker_images/pkgs/container/ubuntu
[hub/nektos/act-environments-ubuntu]: https://hub.docker.com/r/nektos/act-environments-ubuntu
[hub/nektos/act-environments-ubuntu/18.04/size]: https://img.shields.io/docker/image-size/nektos/act-environments-ubuntu/18.04
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ scoop install act
yay -S act
```

### Nix (Linux/macOS)
### [Nix](https://nixos.org) (Linux/macOS)

[Nix recipe](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/misc/act/default.nix)

Global install:

Expand All @@ -85,7 +87,7 @@ or through `nix-shell`:
nix-shell -p act
```

### Go (Linux/Windows/macOS/any other platform supported by Go)
### [Go](https://golang.org) (Linux/Windows/macOS/any other platform supported by Go)

If you have Go 1.16+, you can install latest released version of `act` directly from source by running:

Expand Down Expand Up @@ -227,22 +229,16 @@ export DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}

GitHub Actions offers managed [virtual environments](https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners) for running workflows. In order for `act` to run your workflows locally, it must run a container for the runner defined in your workflow file. Here are the images that `act` uses for each runner type and size:

| GitHub Runner | Micro Docker Image | Medium Docker Image | Large Docker Image |
| --------------- | ------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------- |
| `ubuntu-latest` | [`node:12-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-latest`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-latest`][docker_images] |
| `ubuntu-20.04` | [`node:12-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-20.04`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-20.04`][docker_images] |
| `ubuntu-18.04` | [`node:12-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-18.04`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-18.04`][docker_images] |
| `ubuntu-16.04` | [`node:12-stretch-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-16.04`][docker_images] | `unavailable` |
| GitHub Runner | Micro Docker Image | Medium Docker Image | Large Docker Image |
| --------------- | ------------------------------ | --------------------------------------------------------- | ---------------------------------------------------------- |
| `ubuntu-latest` | [`node:12-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-latest`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-latest`][docker_images] |
| `ubuntu-20.04` | [`node:12-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-20.04`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-20.04`][docker_images] |
| `ubuntu-18.04` | [`node:12-buster-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-18.04`][docker_images] | [`ghcr.io/catthehacker/ubuntu:full-18.04`][docker_images] |

[micro]: https://hub.docker.com/_/buildpack-deps
[docker_images]: https://github.com/catthehacker/docker_images

Below platforms are currently **unsupported and won't work** (see issue [#97](https://github.com/nektos/act/issues/97))

- `windows-latest`
- `windows-2019`
- `macos-latest`
- `macos-10.15`
Windows and macOS based platforms are currently **unsupported and won't work** (see issue [#97](https://github.com/nektos/act/issues/97))

## Please see [IMAGES.md](./IMAGES.md) for more information about the Docker images that can be used with `act`

Expand Down

0 comments on commit 4c69291

Please sign in to comment.