Commit graph

569 commits

Author SHA1 Message Date
Markus Wolf
603cf56878
feat: allow existing logger from context (#859)
We should reuse an existing context logger if available.
This will allow test to setup act with a null logger to assert
log messages.

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
2021-11-12 15:20:45 -08:00
Ryan
cd24df5727
ci(golangci-lint): switch to latest (#870)
* ci(golangci-lint): switch to latest

remove schema override since it was fixed in upstream

Signed-off-by: hackercat <me@hackerc.at>

* fix: apply lint fixes
2021-11-12 12:48:10 -08:00
Markus Wolf
11f6ee37a6
Asset server implementation (#677)
* Add asset server and upload handling of binary files

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Add asset download parts to the asset server

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Add artifact-server-path flag

If the flag is not defined, the artifact server isn't started.
This includes the configuration of ACTIONS_RUNTIME_URL and
ACTIONS_RUNTIME_TOKEN which are set if the server is started.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Move ACTIONS_RUNTIME_* vars into the withGithubEnv setup

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* feat: add artifact server port as flag

This commits adds a flag to define the artifact server port.
If not given, the port defaults to 34567.

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* test: add artifact server tests

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* refactor: use fs.FS

This allows to add tests with in-memory file system

* feat: add support for gzip encoded uploads

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* test: add artifact integration test

* chore: run act tests with asset server path

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* docs: add new cli flags

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* test: add test workflow to testdata

* feat: add log output

* refactor: log shutdown error instead of panic

* feat: use outbound ip for the asset server

This change should allow to use the host ip in macos and windows.
Since docker is running in an intermediate vm, localhost is not
sufficient to have the artifacts in the host system.

* fix: do not use canceled context

To shutdown artifact server, we should not use the already canceled
context but the parent context instead.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* feat: shutdown artifact server at end of pipeline

When the pipeline is done the asset server should be shut down
gracefully.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* fix: close server if graceful shutdown failed

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* fix: ignore server closed error from listen call

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
2021-11-10 09:57:22 -08:00
dependabot[bot]
f8b3563102
build(deps): bump github.com/moby/buildkit from 0.9.1 to 0.9.2 (#864)
Bumps [github.com/moby/buildkit](https://github.com/moby/buildkit) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.9.1...v0.9.2)

---
updated-dependencies:
- dependency-name: github.com/moby/buildkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-10 09:54:38 -08:00
Ryan
80db062472
ci(mergify): fix deprecated strict mode (#862) 2021-11-04 07:23:22 -07:00
Ryan
e9ae7894e3
fix: set sh as default shell for containers (#853)
* fix: set default shell for containers to sh

This matches GitHub Actions behaviour where,
runners use bash since it's guaranteed to exist there
while containers use sh for compatibility

* tests: fixup for default shell
2021-11-03 11:47:47 -07:00
Josh Soref
7c73531008
Fixes (#856)
* fix: avoid triggering %!/(MISSING) for docker output

* fix: suppress --platform for empty platform

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-11-03 11:47:09 -07:00
Ryan
aad724c87a
ci: remove macOS tests (#860)
Running Docker on non-Linux platforms is very painful,
especially in CI. It's better to remove macOS for now,
until a better implementation is present.

Signed-off-by: hackercat <me@hackerc.at>
2021-11-03 11:46:15 -07:00
dependabot[bot]
6a3a47c217
build(deps): bump github.com/docker/docker (#855)
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.8+incompatible to 20.10.10+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.8...v20.10.10)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 01:38:50 +00:00
dependabot[bot]
50dd0c0db1
build(deps): bump github.com/docker/cli (#854)
Bumps [github.com/docker/cli](https://github.com/docker/cli) from 20.10.8+incompatible to 20.10.10+incompatible.
- [Release notes](https://github.com/docker/cli/releases)
- [Commits](https://github.com/docker/cli/compare/v20.10.8...v20.10.10)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-10-31 16:20:06 +00:00
Ryan
2319eb210f
docs: fix brew formula link (#846)
currently it points to nektos owned tap but instruction is for homebrew-core
2021-10-31 13:34:15 +00:00
ChristopherHX
83a28d9512
Close docker client (#789)
* Close docker client!

* Fix nil dereference

* Update run_context.go

* Bump

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-10-24 16:50:43 +00:00
Ryan
f8ddfca6f7
goreleaser: Switch to latest and drop Homebrew config (#848)
* ci: unpin goreleaser version

homebrew issue has been fixed

* ci: drop homebrew from goreleaser

act has been for quite a long time in homebrew-core
and it supports all macos/linux so there is no
reason for us to have separate tap, as it might
confuse some users

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-10-24 09:36:09 -07:00
Ryan
977b526384
ci: switch macos job to macos-10.15 (#849) 2021-10-23 18:37:33 -07:00
dependabot[bot]
b5e8a18683
build(deps): bump github.com/moby/buildkit from 0.9.0 to 0.9.1 (#838)
Bumps [github.com/moby/buildkit](https://github.com/moby/buildkit) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/moby/buildkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 20:24:05 +00:00
Ryan
a0d360236e
fix: rewrite StepContext env (#832)
* fix: rewrite StepContext env

step env from workflow should be last one to be written
fixes https://github.com/nektos/act/issues/777

* test: verify env correctness

* fix: move test into existing workflow
2021-09-28 01:18:59 +00:00
Ryan
6c60af7677
fix: rewrite how image env is merged (#828)
* fix: rewrite how image env is merged

* test: add test for extractFromImageEnv
2021-09-27 19:01:14 +00:00
Ryan
7a426a0f37
refactor: re-implement embed without "unused" import (#830)
* refactor: re-implement `embed` without "unused" import

* fix(gitignore): ignore local docker registry data
2021-09-27 17:33:14 +00:00
dependabot[bot]
bfcf0abd73
build(deps): bump github.com/joho/godotenv from 1.3.0 to 1.4.0 (#824)
Bumps [github.com/joho/godotenv](https://github.com/joho/godotenv) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/joho/godotenv/releases)
- [Commits](https://github.com/joho/godotenv/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/joho/godotenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-26 16:47:33 +00:00
Ryan
c2c8b525f8
Add reading environment from Docker image (#771)
* fix: read envvars from image definition

* fix: add test

* fix: sort slices

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-26 16:37:53 +00:00
Ryan
4d552e65ce
fix: add simple concurrency limit (#823)
Co-authored-by: Casey Lee <cplee@nektos.com>
2021-09-26 16:21:12 +00:00
Mehdi ABAAKOUK
a6aea44fb0
fix(mergify): needs-work label handling (#810) 2021-09-26 09:08:52 -07:00
Ryan
b1e4844aac
ci: pin goreleaser version (#825) 2021-09-26 09:05:43 -07:00
Ryan
5a09eb24ca
Bump all dependencies (and fix dependabot mess) (#822)
* build(deps): bump all Go deps

* build(deps): bump actions/setup-go & actions/stale
2021-09-25 12:13:22 -07:00
Ryan
3c1454825d
fix: mount volume for workflow info (#776)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-24 13:32:22 +00:00
dependabot[bot]
e82f17e230
build(deps): bump codecov/codecov-action from 1.5.2 to 2.1.0 (#819) 2021-09-23 00:12:29 -07:00
Ryan
17652ce80e
Remove ubuntu-16.04 and add missing links for nix/go (#821)
* fix: remove ubuntu-16.04

* fix: add missing links for nix/go

* fix: remove specific platform versions
2021-09-22 19:43:58 +00:00
Josh Soref
aa080d0ed9
Provide hint for -P (#815) 2021-09-13 23:14:41 +00:00
dependabot[bot]
6d7f574859
build(deps): bump github.com/go-git/go-billy/v5 from 5.0.0 to 5.3.1 (#802)
Bumps [github.com/go-git/go-billy/v5](https://github.com/go-git/go-billy) from 5.0.0 to 5.3.1.
- [Release notes](https://github.com/go-git/go-billy/releases)
- [Commits](https://github.com/go-git/go-billy/compare/v5.0.0...v5.3.1)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-billy/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-10 15:34:10 +00:00
Marcin Falkowski
9126f15aa2
support for container option: --hostname (#809) 2021-09-10 05:03:40 +00:00
ChristopherHX
f0fd0af5ce
Refresh hash after pull for branch refs (#791)
* Refresh hash after pull for branch refs

* Bump

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-09-08 16:47:12 +00:00
dependabot[bot]
a7a2659c0e
build(deps): bump github.com/AlecAivazis/survey/v2 from 2.2.7 to 2.3.1 (#803)
Bumps [github.com/AlecAivazis/survey/v2](https://github.com/AlecAivazis/survey) from 2.2.7 to 2.3.1.
- [Release notes](https://github.com/AlecAivazis/survey/releases)
- [Commits](https://github.com/AlecAivazis/survey/compare/v2.2.7...v2.3.1)

---
updated-dependencies:
- dependency-name: github.com/AlecAivazis/survey/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-08 14:52:34 +00:00
Ryan
12928a0ac6
feat: add Dependabot config (#797)
Add Dependabot to keep dependencies up to date
2021-09-08 13:46:45 +00:00
ChristopherHX
6e5bd24728
Cache dockerhub images from linux for macOS (#768)
* Cache dockerhub images from linux for macOS

An attempt to avoid hitting the dockerhub Pull Rate Limit.

* parallelize / refactor docker cache

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-08-30 17:01:30 -07:00
Ryan
4c645b3ed9
Update Go to 1.17 (#787)
* ci: bump Go version & move it to env

* go.mod: bump golang.org/x/term

* ci: capture Windows arm64 binary

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-08-30 11:06:20 -07:00
Ryan
37aaec81f4
feat: improve list (#786) 2021-08-30 15:38:03 +00:00
Ryan
de44a505da
fix: copy whole action dir to container (#774)
fixes https://github.com/nektos/act/issues/754
this will prevent actions from failing that use resources outside
of the action directory
2021-08-10 22:21:52 -07:00
Ryan
bea32d5651
Add proper support for working-directory & fix command builder (#772)
* fix: align other Docker executors to print action

* fix: formatting

* fix: add proper workdir support

* fix: replace script filepath after slice creation

* fix: match substring so it works for pwsh

+ rename containerPath to scriptPath to reflect what value it contains
2021-08-10 19:40:20 +00:00
ChristopherHX
77b3968913
Fix docker: invalid reference format (#767)
* Fix local Docker actions: invalid reference format

* Create Dockerfile

* Create Dockerfile

* Update push.yml

* Revert "Create Dockerfile"

This reverts commit 9d1dbbc2c7fdf52963e55feb4148ac2b14d639d0.

* Fix lint

* fix: re-use image that is already present in repo

ubuntu:latest would pull unnecessary blobs from registry and count toward API limit

* fix: revert change

reverting due to issue in image deletion that will have to be investigated separately

Co-authored-by: Ryan <me@hackerc.at>
2021-08-09 18:16:31 +00:00
Ryan
5c841e22ab
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
2021-08-09 09:07:26 -07:00
Ryan
94fd0ac899
Simplify Matrix decode, add defaults for fail-fast and max-parallel, add test (#763)
* fix[workflow]: multiple fixes for workflow/matrix

fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes #625)
fix[workflow]: skip non-existing includes keys and hard fail on non-existing excludes keys
fix[workflow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes #760)
fix[tests]: add test for planner and runner

* fix(workflow): use yaml node for env key

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-09 15:35:05 +00:00
ChristopherHX
43d46aa62f
Fix format function {{, }} are escapes (#752)
* Fix format function {{, }} are escapes

Added some tests for some corner cases

* Update format function added 2 error checks
2021-08-09 15:19:10 +00:00
ChristopherHX
0ff204b615
Read localaction's from container (#719)
Fix localaction tests (missing checkout)

Co-authored-by: Ryan (hackercat) <me@hackerc.at>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-03 17:39:56 +00:00
Bryan Naegele
531ea02fb9
Fix ImageOS format (#761)
The current algorithm given `ubuntu-18.04` returns `ubuntu18.04` when it should be `ubuntu18` according to https://github.com/actions/virtual-environments/issues/345#issuecomment-581263296.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-08-01 15:39:39 +00:00
Herby Gillot
4036b8a3b1
README: add MacPorts info (#762) 2021-08-01 15:29:13 +00:00
ChristopherHX
149cc19908
Fix defaults (composite) (#753)
* Fix defaults (composite)

* uses-composite: rely on defaults to pass

* Add test_input_required back, needs more tests

* Update Tests to test defaults carefully
2021-07-21 13:50:43 +00:00
Derek Bender
c865a56c5a
Fix url typo in README.md (#746)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-07-14 14:40:09 +00:00
Dave Tapley
73b22a0da6
Add docker context workaround to readme (#749)
* Add docker context workaround to readme

* Update README.md

Co-authored-by: Ryan (hackercat) <me@hackerc.at>

* Fix README

MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [

Co-authored-by: Ryan (hackercat) <me@hackerc.at>
2021-07-07 18:41:23 +00:00
Phil Story
dcbd5837af
Add needs job output (#629)
* Add outputs field to job model

* Add output interpolation for jobs

* Add otto config reference for interpolated job output values into 'needs' context

* Add output interpolation call after job has completed.

* gofmt

* Remove whitespace

* goimports

Co-authored-by: Casey Lee <cplee@nektos.com>
2021-07-01 15:20:20 +00:00
Ryan (hackercat)
1cf422e411
fix: warn Apple M1 (arm64) users (#743)
* fix: warn Apple M1 (arm64) users

* fix: missing dep

* fix: linting

* fix: linting (again)
2021-06-23 18:09:27 +00:00