Update docs, file formatting and docker images (#766)

* docs: fix wrong licence link

* fix: add more formatting settings, reformat all

feat: add vscode extensions recommendations

* docs: update contributing documentation

* fix: remove unnecessary comment

it was due to broken checkout

* docs: rework installation section

it has been brought up few times, new style should be easier
to understand

* docs: update images provided by catthehacker

* docs: replace 18.04 with recent image

* fix: add final new line
This commit is contained in:
Ryan 2021-08-09 16:07:26 +00:00 committed by GitHub
parent 94fd0ac899
commit 5c841e22ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 186 additions and 134 deletions

View File

@ -1,4 +1,16 @@
root = true
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
# Override for Makefile
[{Makefile, makefile, GNUmakefile}]
indent_style = tab
indent_size = 4
[*.{yml.yaml,json}]
indent_style = space
indent_size = 2

View File

@ -3,7 +3,7 @@ name: Feature request
about: Use this template for requesting a feature/enhancement.
title: "Enhancement: "
labels: "kind/feature-request"
assignees: ''
assignees: ""
---
## Describe feature

View File

@ -3,7 +3,7 @@ name: Issue
about: Use this template for reporting a bug/issue.
title: "Issue: <shortly describe issue>"
labels: kind/bug
assignees: ''
assignees: ""
---
<!--

View File

@ -1,7 +1,7 @@
name: 'Chocolatey Packager'
description: 'Create the choco package and push it'
inputs:
version:
version:
description: 'Version of package'
required: true
apiKey:

View File

@ -10,7 +10,7 @@ outputs:
description: 'Output string'
value: ${{ steps.set-output.outputs.string }}
runs:
using: "composite"
using: 'composite'
steps:
- run: echo Hello ${{ inputs.input }}.
shell: bash

View File

@ -1 +1 @@
echo "Output from script"
echo "Output from script"

View File

@ -1,5 +1,5 @@
name: release
on:
on:
push:
tags:
- v*

View File

@ -1,23 +1,23 @@
name: "Close stale issues"
name: 'Close stale issues'
on:
schedule:
- cron: "0 0 * * *"
- cron: '0 0 * * *'
jobs:
stale:
name: Stale
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Issue is stale and will be closed in 14 days unless there is new activity'
stale-pr-message: 'PR is stale and will be closed in 14 days unless there is new activity'
stale-issue-label: 'stale'
exempt-issue-labels: 'stale-exempt'
stale-pr-label: 'stale'
exempt-pr-labels: 'stale-exempt'
remove-stale-when-updated: 'True'
operations-per-run: 500
days-before-stale: 30
days-before-close: 14
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Issue is stale and will be closed in 14 days unless there is new activity'
stale-pr-message: 'PR is stale and will be closed in 14 days unless there is new activity'
stale-issue-label: 'stale'
exempt-issue-labels: 'stale-exempt'
stale-pr-label: 'stale'
exempt-pr-labels: 'stale-exempt'
remove-stale-when-updated: 'True'
operations-per-run: 500
days-before-stale: 30
days-before-close: 14

3
.gitignore vendored
View File

@ -27,5 +27,4 @@ dist/local/act
coverage.txt
.env
#Store your GITHUB_TOKEN secret here for purposes of local testing of actions/checkout and others
.secrets
.secrets

View File

@ -4,7 +4,7 @@ pull_request_rules:
- conflict
actions:
comment:
message: "@{{author}} this pull request is now in conflict 😩"
message: '@{{author}} this pull request is now in conflict 😩'
label:
add:
- conflict
@ -17,10 +17,10 @@ pull_request_rules:
- conflict
- name: warn on needs-work
conditions:
- "#check-failure>=1"
- '#check-failure>=1'
actions:
comment:
message: "@{{author}} this pull request has failed checks 🛠"
message: '@{{author}} this pull request has failed checks 🛠'
label:
add:
- needs-work
@ -38,7 +38,7 @@ pull_request_rules:
- needs-work
- name: Automatic maintainer assignment
conditions:
- "-approved-reviews-by=@nektos/act-maintainers"
- '-approved-reviews-by=@nektos/act-maintainers'
- -draft
- -merged
- -closed
@ -51,12 +51,12 @@ pull_request_rules:
- check-success=snapshot
actions:
request_reviews:
teams:
- "@nektos/act-maintainers"
teams:
- '@nektos/act-maintainers'
- name: Automatic committer assignment
conditions:
- "approved-reviews-by=@nektos/act-maintainers"
- "-approved-reviews-by=@nektos/act-committers"
- 'approved-reviews-by=@nektos/act-maintainers'
- '-approved-reviews-by=@nektos/act-committers'
- -draft
- -merged
- -closed
@ -69,12 +69,12 @@ pull_request_rules:
- check-success=snapshot
actions:
request_reviews:
teams:
- "@nektos/act-committers"
teams:
- '@nektos/act-committers'
- name: Automatic merge on approval
conditions:
- "#changes-requested-reviews-by=0"
- "approved-reviews-by=@nektos/act-committers"
- '#changes-requested-reviews-by=0'
- 'approved-reviews-by=@nektos/act-committers'
- -draft
- -merged
- -closed

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
**/testdata
pkg/runner/res

7
.prettierrc.yml Normal file
View File

@ -0,0 +1,7 @@
overrides:
- files: '*.yml'
options:
singleQuote: true
- files: '*.json'
options:
singleQuote: false

9
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"recommendations": [
"editorconfig.editorconfig",
"golang.go",
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"redhat.vscode-yaml"
]
}

15
.vscode/settings.json vendored
View File

@ -1,6 +1,13 @@
{
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fix"
]
"go.lintTool": "golangci-lint",
"go.lintFlags": ["--fix"],
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@ -1,67 +1,69 @@
# Contributing to Act
Help wanted! We'd love your contributions to Act. Please review the following guidelines before contributing. Also, feel free to propose changes to these guidelines by updating this file and submitting a pull request.
Help wanted! We'd love your contributions to Act. Please review the following guidelines before contributing. Also, feel free to propose changes to these guidelines by updating this file and submitting a pull request.
* [I have a question...](#questions)
* [I found a bug...](#bugs)
* [I have a feature request...](#features)
* [I have a contribution to share...](#process)
- [I have a question...](#questions)
- [I found a bug...](#bugs)
- [I have a feature request...](#features)
- [I have a contribution to share...](#process)
## <a name="questions"></a> Have a Question?
## <a id="questions"></a> Have a Question?
Please don't open a GitHub issue for questions about how to use `act`, as the goal is to use issues for managing bugs and feature requests. Issues that are related to general support will be closed and redirected to our gitter room.
Please don't open a GitHub issue for questions about how to use `act`, as the goal is to use issues for managing bugs and feature requests. Issues that are related to general support will be closed and redirected to our gitter room.
For all support related questions, please ask the question in our gitter room: [nektos/act](https://gitter.im/nektos/act).
## <a name="bugs"></a> Found a Bug?
## <a id="bugs"></a> Found a Bug?
If you've identified a bug in `act`, please [submit an issue](#issue) to our GitHub repo: [nektos/act](https://github.com/nektos/act/issues/new). Please also feel free to submit a [Pull Request](#pr) with a fix for the bug!
If you've identified a bug in `act`, please [submit an issue](#issue) to our GitHub repo: [nektos/act](https://github.com/nektos/act/issues/new). Please also feel free to submit a [Pull Request](#pr) with a fix for the bug!
## <a name="features"></a> Have a Feature Request?
## <a id="features"></a> Have a Feature Request?
All feature requests should start with [submitting an issue](#issue) documenting the user story and acceptance criteria. Again, feel free to submit a [Pull Request](#pr) with a proposed implementation of the feature.
All feature requests should start with [submitting an issue](#issue) documenting the user story and acceptance criteria. Again, feel free to submit a [Pull Request](#pr) with a proposed implementation of the feature.
## <a name="process"></a> Ready to Contribute
## <a id="process"></a> Ready to Contribute
### <a name="issue"></a> Create an issue
### <a id="issue"></a> Create an issue
Before submitting a new issue, please search the issues to make sure there isn't a similar issue doesn't already exist.
Assuming no existing issues exist, please ensure you include the following bits of information when submitting the issue to ensure we can quickly reproduce your issue:
* Version of `act`
* Platform (Linux, macOS, Windows)
* The complete `main.workflow` file used
* The complete command that was executed
* Any output from the command
* Details of the expected results and how they differed from the actual results
Assuming no existing issues exist, please ensure you include required information when submitting the issue to ensure we can quickly reproduce your issue.
We may have additional questions and will communicate through the GitHub issue, so please respond back to our questions to help reproduce and resolve the issue as quickly as possible.
New issues can be created with in our [GitHub repo](https://github.com/nektos/act/issues/new).
### <a name="pr"></a>Pull Requests
### <a id="pr"></a>Pull Requests
Pull requests should target the `master` branch. Please also reference the issue from the description of the pull request using [special keyword syntax](https://help.github.com/articles/closing-issues-via-commit-messages/) to auto close the issue when the PR is merged. For example, include the phrase `fixes #14` in the PR description to have issue #14 auto close.
Pull requests should target the `master` branch. Please also reference the issue from the description of the pull request using [special keyword syntax](https://help.github.com/articles/closing-issues-via-commit-messages/) to auto close the issue when the PR is merged. For example, include the phrase `fixes #14` in the PR description to have issue #14 auto close.
### <a name="style"></a> Styleguide
### <a id="style"></a> Styleguide
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Here are a few points to keep in mind:
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Here are a few points to keep in mind:
* Please run `go fmt ./...` before committing to ensure code aligns with go standards.
* All dependencies must be defined in the `go.mod` file.
* For details on the approved style, check out [Effective Go](https://golang.org/doc/effective_go.html).
- Please run `go fmt ./...` before committing to ensure code aligns with go standards.
- We use [`golangci-lint`](https://golangci-lint.run/) for linting Go code, run `golangci-lint run --fix` before submitting PR. Editors such as Visual Studio Code or JetBrains IntelliJ; with Go support plugin will offer `golangci-lint` automatically.
- There are additional linters and formatters for files such as Markdown documents or YAML/JSON:
- Please refer to the [Makefile](Makefile) or [`lint` job in our workflow](.github/workflows/checks.yml) to see how to those linters/formatters work.
- You can lint codebase by running `go run main.go -j lint --env RUN_LOCAL=true` or `act -j lint --env RUN_LOCAL=true`
- In `Makefile`, there are tools that require `npx` which is shipped with `nodejs`.
- Our `Makefile` exports `GITHUB_TOKEN` from `~/.config/github/token`, you have been warned.
- You can run `make pr` to cleanup dependencies, format/lint code and run tests.
- All dependencies must be defined in the `go.mod` file.
- Advanced IDEs and code editors (like VSCode) will take care of that, but to be sure, run `go mod tidy` to validate dependencies.
- For details on the approved style, check out [Effective Go](https://golang.org/doc/effective_go.html).
- Before running tests, please be aware that they are multi-architecture so for them to not fail, you need to run `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64` before ([more info available in #765](https://github.com/nektos/act/issues/765)).
Also, consider the original design principles:
* **Polyglot** - There will be no prescribed language or framework for developing the microservices. The only requirement will be that the service will be run inside a container and exposed via an HTTP endpoint.
* **Cloud Provider** - At this point, the tool will assume AWS for the cloud provider and will not be written in a cloud agnostic manner. However, this does not preclude refactoring to add support for other providers at a later time.
* **Declarative** - All resource administration will be handled in a declarative vs. imperative manner. A file will be used to declared the desired state of the resources and the tool will simply assert the actual state matches the desired state. The tool will accomplish this by generating CloudFormation templates.
* **Stateless** - The tool will not maintain its own state. Rather, it will rely on the CloudFormation stacks to determine the state of the platform.
* **Secure** - All security will be managed by AWS IAM credentials. No additional authentication or authorization mechanisms will be introduced.
- **Polyglot** - There will be no prescribed language or framework for developing the microservices. The only requirement will be that the service will be run inside a container and exposed via an HTTP endpoint.
- **Cloud Provider** - At this point, the tool will assume AWS for the cloud provider and will not be written in a cloud agnostic manner. However, this does not preclude refactoring to add support for other providers at a later time.
- **Declarative** - All resource administration will be handled in a declarative vs. imperative manner. A file will be used to declared the desired state of the resources and the tool will simply assert the actual state matches the desired state. The tool will accomplish this by generating CloudFormation templates.
- **Stateless** - The tool will not maintain its own state. Rather, it will rely on the CloudFormation stacks to determine the state of the platform.
- **Secure** - All security will be managed by AWS IAM credentials. No additional authentication or authorization mechanisms will be introduced.
### License
By contributing your code, you agree to license your contribution under the terms of the [MIT License](LICENSE.md).
By contributing your code, you agree to license your contribution under the terms of the [MIT License](LICENSE).
All files are released with the MIT license.

View File

@ -17,12 +17,12 @@
**Note: `catthehacker/ubuntu` images are based on Ubuntu root filesystem**
| Image | Size | GitHub Repository |
| ----------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------- |
| [`catthehacker/ubuntu:act-latest`][hub/catthehacker/ubuntu] | ![`act-latest`][hub/catthehacker/ubuntu/act-latest/size] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`catthehacker/ubuntu:act-20.04`][hub/catthehacker/ubuntu] | ![`act-20.04`][hub/catthehacker/ubuntu/act-20.04/size] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`catthehacker/ubuntu:act-18.04`][hub/catthehacker/ubuntu] | ![`act-18.04`][hub/catthehacker/ubuntu/act-18.04/size] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`catthehacker/ubuntu:act-16.04`][hub/catthehacker/ubuntu] | ![`act-16.04`][hub/catthehacker/ubuntu/act-16.04/size] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| Image | GitHub Repository |
| -------------------------------------------------------------------- | ------------------------------------------------------------- |
| [`ghcr.io/catthehacker/ubuntu:act-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`ghcr.io/catthehacker/ubuntu:act-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`ghcr.io/catthehacker/ubuntu:act-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| [`ghcr.io/catthehacker/ubuntu:act-16.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
## Images based on [`actions/virtual-environments`][gh/actions/virtual-environments]
@ -34,15 +34,11 @@
| [`nektos/act-environments-ubuntu:18.04-lite`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04-lite`][hub/nektos/act-environments-ubuntu/18.04-lite/size] | [`nektos/act-environments`][gh/nektos/act-environments] |
| [`nektos/act-environments-ubuntu:18.04-full`][hub/nektos/act-environments-ubuntu] | ![`nektos:18.04-full`][hub/nektos/act-environments-ubuntu/18.04-full/size] | [`nektos/act-environments`][gh/nektos/act-environments] |
| Image | Size | GitHub Repository |
| ----------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------- |
| [`catthehacker/ubuntu:full-20.04`][hub/catthehacker/ubuntu] | ![`full-20.04`][hub/catthehacker/ubuntu/full-20.04/size] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
## Other images
| Image | Size | GitHub Repository |
| ---------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------- |
| [`catthehacker/alpine:act`][hub/catthehacker/alpine] | ![`alpine:act`][hub/catthehacker/alpine/act/size] | [`catthehacker/docker-images`][gh/catthehacker/docker_images] |
| Image | GitHub Repository |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`ghcr.io/catthehacker/ubuntu:full-latest`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
| [`ghcr.io/catthehacker/ubuntu:full-20.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
| [`ghcr.io/catthehacker/ubuntu:full-18.04`][ghcr/catthehacker/ubuntu] | [`catthehacker/virtual-environments-fork`][gh/catthehacker/virtual-environments-fork] |
Feel free to make a pull request with your image added here
@ -52,22 +48,12 @@ Feel free to make a pull request with your image added here
[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
[hub/catthehacker/ubuntu]: https://hub.docker.com/r/catthehacker/ubuntu
[hub/catthehacker/ubuntu/act-latest/size]: https://img.shields.io/docker/image-size/catthehacker/ubuntu/act-latest
[hub/catthehacker/ubuntu/act-20.04/size]: https://img.shields.io/docker/image-size/catthehacker/ubuntu/act-20.04
[hub/catthehacker/ubuntu/act-18.04/size]: https://img.shields.io/docker/image-size/catthehacker/ubuntu/act-18.04
[hub/catthehacker/ubuntu/act-16.04/size]: https://img.shields.io/docker/image-size/catthehacker/ubuntu/act-16.04
[hub/catthehacker/ubuntu/full-20.04/size]: https://img.shields.io/docker/image-size/catthehacker/ubuntu/full-20.04
[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
[hub/nektos/act-environments-ubuntu/18.04-lite/size]: https://img.shields.io/docker/image-size/nektos/act-environments-ubuntu/18.04-lite
[hub/nektos/act-environments-ubuntu/18.04-full/size]: https://img.shields.io/docker/image-size/nektos/act-environments-ubuntu/18.04-full
<!-- Other images links -->
[hub/catthehacker/alpine]: https://hub.docker.com/r/catthehacker/alpine
[hub/catthehacker/alpine/act/size]: https://img.shields.io/docker/image-size/catthehacker/alpine/act
<!--
[hub/<username>/<image>]: https://hub.docker.com/r/[username]/[image]
[hub/<username>/<image>/<tag>/size]: https://img.shields.io/docker/image-size/[username]/[image]/[tag]
@ -78,4 +64,4 @@ Feel free to make a pull request with your image added here
[gh/nektos/act-environments]: https://github.com/nektos/act-environments
[gh/actions/virtual-environments]: https://github.com/actions/virtual-environments
[gh/catthehacker/docker_images]: https://github.com/catthehacker/docker_images
[gh/catthehacker/virtual-environments]: https://github.com/catthehacker/virtual-environments
[gh/catthehacker/virtual-environments-fork]: https://github.com/catthehacker/virtual-environments-fork

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019
Copyright (c) 2019
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -18,6 +18,9 @@ ifeq (true,$(HAS_TOKEN))
export GITHUB_TOKEN := $(shell cat ~/.config/github/token)
endif
.PHONY: pr
pr: tidy format-all lint test
.PHONY: build
build:
go build -ldflags "-X main.version=$(VERSION)" -o dist/local/act main.go
@ -26,6 +29,11 @@ build:
format:
go fmt ./...
.PHONY: format-all
format-all:
go fmt ./...
npx prettier --write .
.PHONY: test
test:
go test ./...
@ -37,11 +45,11 @@ lint-go:
.PHONY: lint-js
lint-js:
standard $(FIX)
npx standard $(FIX)
.PHONY: lint-md
lint-md:
markdownlint . $(FIX)
npx markdownlint . $(FIX)
.PHONY: lint-rest
lint-rest:
@ -67,6 +75,10 @@ lint-fix: lint-md lint-go
fix:
make lint-fix fix=true
.PHONY: tidy
tidy:
go mod tidy
.PHONY: install
install: build
@cp dist/local/act $(PREFIX)/bin/act

View File

@ -31,28 +31,23 @@ If you are using Linux, you will need to [install Docker Engine](https://docs.do
`act` is currently not supported with `podman` or other container backends (it might work, but it's not guaranteed). Please see [#303](https://github.com/nektos/act/issues/303) for updates.
## Homebrew
## Installation through package managers
To install with [Homebrew](https://brew.sh/), run:
### [Homebrew](https://brew.sh/) (Linux/macOS)
[![homebrew version](https://img.shields.io/homebrew/v/act)](https://github.com/nektos/homebrew-tap/blob/master/Formula/act.rb)
```shell
brew install act
```
To install with [MacPorts](https://www.macports.org), run:
### [MacPorts](https://www.macports.org) (macOS)
```shell
sudo port install act
```
Alternatively, you can use the following:
```shell
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
```
If you are running Windows, download the [latest release](https://github.com/nektos/act/releases/latest) and add the binary into your PATH.
If you are using [Chocolatey](https://chocolatey.org/) then run:
### [Chocolatey](https://chocolatey.org/) (Windows)
[![choco-shield](https://img.shields.io/chocolatey/v/act-cli)](https://community.chocolatey.org/packages/act-cli)
@ -60,7 +55,7 @@ If you are using [Chocolatey](https://chocolatey.org/) then run:
choco install act-cli
```
If you are using [Scoop](https://scoop.sh/) then run:
### [Scoop](https://scoop.sh/) (Windows)
[![scoop-shield](https://img.shields.io/scoop/v/act)](https://github.com/ScoopInstaller/Main/blob/master/bucket/act.json)
@ -68,7 +63,7 @@ If you are using [Scoop](https://scoop.sh/) then run:
scoop install act
```
If you are running Arch Linux, you can install the [act](https://aur.archlinux.org/packages/act/) package with your favorite package manager:
### [AUR](https://aur.archlinux.org/packages/act/) (Linux)
[![aur-shield](https://img.shields.io/aur/version/act)](https://aur.archlinux.org/packages/act/)
@ -76,18 +71,22 @@ If you are running Arch Linux, you can install the [act](https://aur.archlinux.o
yay -S act
```
If you are using NixOS or the Nix package manager on another platform you can install act globally by running
### Nix (Linux/macOS)
Global install:
```sh
nix-env -iA nixpkgs.act
```
or in a shell by running
or through `nix-shell`:
```sh
nix-shell -p act
```
### Go (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:
```sh
@ -100,7 +99,27 @@ or if you want to install latest unreleased version:
go install github.com/nektos/act@master
```
# Commands
If you want a smaller binary size, run above commands with `-ldflags="-s -w"`
```sh
go install -ldflags="-s -w" github.com/nektos/act@...
```
## Other install options
### Bash script
Run this command in your terminal:
```shell
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
```
### Manual download
Download the [latest release](https://github.com/nektos/act/releases/latest) and add the path to your binary into your PATH.
# Example commands
```sh
# Command structure:
@ -208,17 +227,15 @@ 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] | [`catthehacker/ubuntu:act-latest`][medium] | [`catthehacker/ubuntu:full-20.04`][large-cat] |
| `ubuntu-20.04` | [`node:12-buster-slim`][micro] | [`catthehacker/ubuntu:act-20.04`][medium] | [`catthehacker/ubuntu:full-20.04`][large-cat] |
| `ubuntu-18.04` | [`node:12-buster-slim`][micro] | [`catthehacker/ubuntu:act-18.04`][medium] | [`nektos/act-environments-ubuntu:18.04`][large-act] |
| `ubuntu-16.04` | [`node:12-stretch-slim`][micro] | [`catthehacker/ubuntu:act-16.04`][medium] | `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] |
| `ubuntu-16.04` | [`node:12-stretch-slim`][micro] | [`ghcr.io/catthehacker/ubuntu:act-16.04`][docker_images] | `unavailable` |
[micro]: https://hub.docker.com/_/buildpack-deps
[medium]: https://github.com/catthehacker/docker_images
[large-cat]: https://github.com/catthehacker/docker_images
[large-act]: https://github.com/nektos/act-environments
[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))
@ -244,8 +261,7 @@ If you need an environment that works just like the corresponding GitHub runner
:warning: :elephant: `*** WARNING - this image is >18GB 😱***`
- [`catthehacker/ubuntu:full-20.04`](https://hub.docker.com/r/catthehacker/ubuntu/tags) - built from Dockerfile based on the Packer template from [actions/virtual-environments](https://github.com/actions/runner).
This image size is about `61GB` unpacked (`23GB` compressed) but contains more recent software versions (as of date of build).
- [`ghcr.io/catthehacker/ubuntu:full-*`](https://github.com/catthehacker/docker_images/pkgs/container/ubuntu) - built from Packer template provided by GitHub, see [catthehacker/virtual-environments-fork](https://github.com/catthehacker/virtual-environments-fork) or [catthehacker/docker_images](https://github.com/catthehacker/docker_images) for more information
## Use an alternative runner image

View File

@ -308,11 +308,11 @@ func defaultImageSurvey(actrc string) error {
var option string
switch answer {
case "Large":
option = "-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04"
option = "-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:full-latest\n-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:full-20.04\n-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:full-18.04\n"
case "Medium":
option = "-P ubuntu-latest=catthehacker/ubuntu:act-latest\n-P ubuntu-20.04=catthehacker/ubuntu:act-20.04\n-P ubuntu-18.04=catthehacker/ubuntu:act-18.04\nubuntu-16.04=catthehacker/ubuntu:act-16.04"
option = "-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest\n-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04\n-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04\n-P ubuntu-16.04=ghcr.io/catthehacker/ubuntu:act-16.04\n"
case "Micro":
option = "-P ubuntu-latest=node:12-buster-slim\n-P ubuntu-20.04=node:12-buster-slim\n-P ubuntu-18.04=node:12-buster-slim\n-P ubuntu-16.04=node:12-stretch-slim"
option = "-P ubuntu-latest=node:12-buster-slim\n-P ubuntu-20.04=node:12-buster-slim\n-P ubuntu-18.04=node:12-buster-slim\n-P ubuntu-16.04=node:12-stretch-slim\n"
}
f, err := os.Create(actrc)

View File

@ -2,7 +2,7 @@ coverage:
status:
project:
default:
target: auto # auto compares coverage to the previous base commit
target: auto # auto compares coverage to the previous base commit
threshold: 1%
patch:
default: