update for platforms
Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
9511f5baf4
commit
3d3fc59dbe
3 changed files with 26 additions and 6 deletions
26
README.md
26
README.md
|
@ -47,13 +47,33 @@ act -j test
|
|||
# Run in dry-run mode:
|
||||
act -n
|
||||
|
||||
# Run in reuse mode to save state:
|
||||
act -r
|
||||
|
||||
# Enable verbose-logging (can be used with any of the above commands)
|
||||
act -v
|
||||
```
|
||||
|
||||
# Platforms
|
||||
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:
|
||||
|
||||
| GitHub Runner | Docker Image |
|
||||
| --------------- | ------------ |
|
||||
| ubuntu-latest | [ubuntu:18.04](https://hub.docker.com/_/ubuntu) |
|
||||
| ubuntu-18.04 | [ubuntu:18.04](https://hub.docker.com/_/ubuntu) |
|
||||
| ubuntu-16.04 | [ubuntu:16.04](https://hub.docker.com/_/ubuntu) |
|
||||
| windows-latest | `unsupported` |
|
||||
| windows-2019 | `unsupported` |
|
||||
| macos-latest | `unsupported` |
|
||||
| macos-10.15 | `unsupported` |
|
||||
|
||||
These default images do not contain all the tools that GitHub Actions offers by default in their runners. If you need an environment that works just like the corresponding GitHub runner then consider using an image provided by [nektos/act-environments](https://github.com/nektos/act-environments):
|
||||
|
||||
* [nektos/act-environments-ubuntu:18.04](https://hub.docker.com/r/nektos/act-environments-ubuntu/tags) - built from the Packer file GitHub uses in [actions/virtual-environments](https://github.com/actions/runner).
|
||||
|
||||
To use a different image for the runner, use the `-P` option:
|
||||
|
||||
```
|
||||
act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04
|
||||
```
|
||||
|
||||
# Secrets
|
||||
|
||||
To run `act` with secrets, you can enter them interactively or supply them as environment variables. The following options are available for providing secrets:
|
||||
|
|
|
@ -15,7 +15,7 @@ type Input struct {
|
|||
platforms []string
|
||||
dryrun bool
|
||||
forcePull bool
|
||||
logOutput bool
|
||||
noOutput bool
|
||||
}
|
||||
|
||||
func (i *Input) resolve(path string) string {
|
||||
|
|
|
@ -38,7 +38,7 @@ func Execute(ctx context.Context, version string) {
|
|||
rootCmd.PersistentFlags().StringVarP(&input.workflowsPath, "workflows", "W", "./.github/workflows/", "path to workflow files")
|
||||
rootCmd.PersistentFlags().StringVarP(&input.workdir, "directory", "C", ".", "working directory")
|
||||
rootCmd.PersistentFlags().BoolP("verbose", "v", false, "verbose output")
|
||||
rootCmd.PersistentFlags().BoolVarP(&input.logOutput, "output", "o", false, "log output from steps")
|
||||
rootCmd.PersistentFlags().BoolVarP(&input.noOutput, "quiet", "q", false, "disable logging of output from steps")
|
||||
rootCmd.PersistentFlags().BoolVarP(&input.dryrun, "dryrun", "n", false, "dryrun mode")
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
os.Exit(1)
|
||||
|
@ -97,7 +97,7 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
|
|||
ForcePull: input.forcePull,
|
||||
ReuseContainers: input.reuseContainers,
|
||||
Workdir: input.Workdir(),
|
||||
LogOutput: input.logOutput,
|
||||
LogOutput: !input.noOutput,
|
||||
Secrets: newSecrets(input.secrets),
|
||||
Platforms: input.newPlatforms(),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue