act icon indicating copy to clipboard operation
act copied to clipboard

Additional run when using matrix

Open azzazzel opened this issue 5 years ago โ€ข 3 comments

With

โฏ act --version
act version 0.2.19

and this workflow (taken from the docs for the sole purpose of demonstrating the issue) :

name: Node.js CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - node-version: 10.x
            site: "prod"
            datacenter: "site-a"
          - node-version: 12.x
            site: "dev"
            datacenter: "site-b"
    steps:
      - name: Echo site details
        env:
          SITE: ${{ matrix.site }}
          DATACENTER: ${{ matrix.datacenter }}
        run: echo $SITE $DATACENTER

There are 3 runs instead of 2:

โฏ act
[Node.js CI/build-1] ๐Ÿš€  Start image=catthehacker/ubuntu:act-latest
[Node.js CI/build-3] ๐Ÿงช  Matrix: map[datacenter:site-b node-version:12.x site:dev]
[Node.js CI/build-2] ๐Ÿงช  Matrix: map[datacenter:site-a node-version:10.x site:prod]
[Node.js CI/build-3] ๐Ÿš€  Start image=catthehacker/ubuntu:act-latest
[Node.js CI/build-2] ๐Ÿš€  Start image=catthehacker/ubuntu:act-latest
[Node.js CI/build-2]   ๐Ÿณ  docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/build-3]   ๐Ÿณ  docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/build-1]   ๐Ÿณ  docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Node.js CI/build-3] โญ  Run Echo site details
[Node.js CI/build-2] โญ  Run Echo site details
[Node.js CI/build-1] โญ  Run Echo site details
| prod site-a
| dev site-b
[Node.js CI/build-2]   โœ…  Success - Echo site details
[Node.js CI/build-3]   โœ…  Success - Echo site details
| 
[Node.js CI/build-1]   โœ…  Success - Echo site details

As you can see one of them does not have the variables set up correctly. In the real scenario that causes jobs (and thus the whole workflow) to fail when running it with act.

azzazzel avatar Jan 28 '21 11:01 azzazzel

This was fixed in #503. Unfortunately, a new release with the fix hasn't been released yet, but if you build act from master, it should result in only 2 builds.

edtan avatar Jan 28 '21 23:01 edtan

Thanks for the update. As I'm not dealing with Go on a daily basis I'd rather wait for the next release than investing time in installing and learning the toolchain needed to build Go apps. I hope I will not have to wait too long.

azzazzel avatar Jan 29 '21 10:01 azzazzel

Issue is stale and will be closed in 14 days unless there is new activity

github-actions[bot] avatar Mar 01 '21 00:03 github-actions[bot]