* fixes include directive of strategy build.
* Adds test for include and exclude in matrix builds.
* ubuntu-16.04 instead of 20.04
* Adds more platforms for runner_test
Prevent most "skipping unsupported platform messages".
* correct printing for unsupported platform
* fix merge
* Test more if env variants
* The correct negation syntax is !=
* Make the Interpolate function support negated booleans from envs
* Move assert := a.New(t) into t.Run
This uncovered that some of the test premisses was wrong and the
Eval Bool function also had flaws
* Remove a stray logrus import
* Add an ACT env set to true
This can be used to skip certain steps that you don't want to run locally
when testing. E.g. steps that sends messages to Slack channels on successful
builds etc.
* Add a description about env.ACT to the readme
* A new attempt at Interpolation and EvalBool
* One small merge fix
* Remove some fmt.Printfs
* Fix some merge conflicts
* Test more if env variants
* The correct negation syntax is !=
* Make the Interpolate function support negated booleans from envs
* Move assert := a.New(t) into t.Run
This uncovered that some of the test premisses was wrong and the
Eval Bool function also had flaws
* Remove a stray logrus import
* When running on Windows the correct path separator must be used. filePath.join is OS aware, so when we want to use forward slash use path.join instead.
on windows docker cp should end with \. when copying a directory
when running npm modules we should pass in path with all forward slashes
This fixes#331
* When calculating relative folders on Windows for destination path on Linux, we need to change \ for /
* Reduce complexity by extracting methods
* V1 does not point to a file that does not exist
* Looks like something else is the cause of this test breaking. Last successful build is #371, builds after that are failing
* Rewrite contexts before evaluating them
* Precompile context and expression patterns
* Test trim before rewrite
The current contextPattern is quite constraining and would fail the
rewrite of a context with trailing spaces. Triming happens during the
execution of Interpolate, and these tests aim to detect future breaking
changes on this behavior.
Co-authored-by: Casey Lee <cplee@nektos.com>
* Pull latest changes from ref using cached repo
Act switched from checking out a branch to checking out
a hash in order to resolve#24 - see
bc5c23e8e4
This had a side effect of preventing `w.Pull()` from updating
to the latest commit if a ref was a branch/tag and the repo
already exists on disk.
This commit checks if input.Ref is equivalent to the resolved
hash, and runs `r.Fetch()` and checks out the branch for input.Ref
if it is different. `w.Pull()` can then pull the latest changes
before we checkout `*hash` again like normal
* Extract CloneIfRequired to reduce cyclomatic complexity
Co-authored-by: Casey Lee <cplee@nektos.com>
Currently setting workflows with the -W (--workflows) flag only accepts
a folder. It is not possible to run a single workflow.yml file.
This commit allows either a single file or a directory to be passed into
the workflows flag.
Previously secrets would be shown in log output as provided. This
commit updates the stepLogFormatter to replace any instance of the secret
string with "***", as GitHub Actions would
Known issues: If the secret is a generic string (such as "docker"), all
occurances of that string will be replaced in the output
Co-authored-by: Casey Lee <cplee@nektos.com>
This adds the `-a` flag when running `act` to change the username of the GITHUB_ACTOR environment variable
Co-authored-by: Casey Lee <cplee@nektos.com>
* Ignore .idea
* Add Env to the RunContext vm so we can Evaluate and Interpolate `env.xx`
* Make EvalBool support expressions more in line with the github runner
* Turns out Boolean(value) is what github is doing after all
* Add test for github context as well
In #222 I added case normalisation to ReadAction() to ensure that Docker and docker are interpreted the same way.
I realised that this was being done at the wrong level and required multiple type conversions. By implementing `func (a ActionRunsUsing) UnmarshalYAML` we can lowercase the string as it's being unserialized
This has an added benefit that any time this type is hydrated the `runs.using` key will be lowercased, rather than relying on `ReadAction()`
Currently, providing `using: Docker` is an error as the switch statement in `step_context.go` is case sensitive.
Actions run successfully on GitHub with `using: Docker` leading me to believe that they're case insensitive. This commit updates `act` to match
Co-authored-by: Casey Lee <cplee@nektos.com>
The string comparison in `step_context.go` is currently case sensitive. This commit adds an error that returns the valid options and tells the user what value they passed