Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected matrix include behaviour #2220

Open
jmount-boss opened this issue Feb 14, 2024 · 1 comment
Open

Unexpected matrix include behaviour #2220

jmount-boss opened this issue Feb 14, 2024 · 1 comment
Labels
kind/bug Something isn't working

Comments

@jmount-boss
Copy link

jmount-boss commented Feb 14, 2024

Bug report info

act version:            0.2.59
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/james/.config/act/actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.13
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.59 -X main.commit=b7a8145d09a7469e03c57e24230cbba109218faf -X main.date=2024-02-01T22:32:29Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         b7a8145d09a7469e03c57e24230cbba109218faf
		vcs.time:             2024-02-01T22:32:06Z
		vcs.modified:         false
Docker Engine:
	Engine version:        25.0.1
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 22.04.3 LTS
	OS type:               linux
	OS version:            22.04
	OS arch:               x86_64
	OS kernel:             6.1.0-1033-oem
	OS CPU:                12
	OS memory:             39770 MB
	Security options:
		name=apparmor
		name=seccomp,profile=builtin
		name=cgroupns

Command used with act

act -W '.github/workflows/build.yml'

Describe issue

The matrix configuration appears to be inconsistent with the documentation provided by Github here. Expected only 6 configurations, yet Act runs 7. The matrix configuration '{color: green}' should not exist according to the Github documentation.

Link to GitHub repository

No response

Workflow content

name: Build & Test

on:
  push:

# Global environment variables

jobs:
  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        fruit: [apple, pear]
        animal: [cat, dog]
        include:
          - color: green
          - color: pink
            animal: cat
          - fruit: apple
            shape: circle
          - fruit: banana
          - fruit: banana
            animal: cat

    steps: 
      - name: Matrix Configuration
        run: |
          echo "Color: ${{ matrix.color }}"

Relevant log output

[Build & Test/build-1] 🚀  Start image=catthehacker/ubuntu:act-20.04
[Build & Test/build-2] 🚀  Start image=catthehacker/ubuntu:act-20.04
[Build & Test/build-3] 🚀  Start image=catthehacker/ubuntu:act-20.04
[Build & Test/build-4] 🚀  Start image=catthehacker/ubuntu:act-20.04
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-2]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-4]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-1]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-3]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-3]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-4]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-2]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-1]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-3]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-4]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-2]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-1]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-2] 🧪  Matrix: map[animal:dog fruit:apple shape:circle]
[Build & Test/build-3] 🧪  Matrix: map[animal:cat color:pink fruit:pear]
[Build & Test/build-4] 🧪  Matrix: map[animal:dog fruit:pear]
[Build & Test/build-3] ⭐ Run Main Matrix Configuration
[Build & Test/build-2] ⭐ Run Main Matrix Configuration
[Build & Test/build-1] 🧪  Matrix: map[animal:cat color:pink fruit:apple shape:circle]
[Build & Test/build-4] ⭐ Run Main Matrix Configuration
[Build & Test/build-2]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
[Build & Test/build-3]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
[Build & Test/build-1] ⭐ Run Main Matrix Configuration
[Build & Test/build-4]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| Object
[Build & Test/build-4]   ✅  Success - Main Matrix Configuration
| Object
| Object
[Build & Test/build-2]   ✅  Success - Main Matrix Configuration
[Build & Test/build-3]   ✅  Success - Main Matrix Configuration
[Build & Test/build-4] Cleaning up container for job build
[Build & Test/build-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
[Build & Test/build-2] Cleaning up container for job build
[Build & Test/build-3] Cleaning up container for job build
| Object
[Build & Test/build-1]   ✅  Success - Main Matrix Configuration
[Build & Test/build-1] Cleaning up container for job build
[Build & Test/build-4] 🏁  Job succeeded
[Build & Test/build-2] 🏁  Job succeeded
[Build & Test/build-5] 🚀  Start image=catthehacker/ubuntu:act-20.04
[Build & Test/build-6] 🚀  Start image=catthehacker/ubuntu:act-20.04
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-6]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-5]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
[Build & Test/build-1] 🏁  Job succeeded
[Build & Test/build-7] 🚀  Start image=catthehacker/ubuntu:act-20.04
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-7]   🐳  docker pull image=catthehacker/ubuntu:act-20.04 platform= username= forcePull=true
[Build & Test/build-3] 🏁  Job succeeded
INFO[0006] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-6]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
INFO[0006] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-7]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
INFO[0006] Parallel tasks (0) below minimum, setting to 1 
[Build & Test/build-5]   🐳  docker create image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-6]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-7]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-5]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Build & Test/build-6] 🧪  Matrix: map[fruit:banana]
[Build & Test/build-7] 🧪  Matrix: map[animal:cat fruit:banana]
[Build & Test/build-5] 🧪  Matrix: map[color:green]
[Build & Test/build-6] ⭐ Run Main Matrix Configuration
[Build & Test/build-7] ⭐ Run Main Matrix Configuration
[Build & Test/build-5] ⭐ Run Main Matrix Configuration
[Build & Test/build-6]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
[Build & Test/build-7]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
[Build & Test/build-5]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| Object
[Build & Test/build-6]   ✅  Success - Main Matrix Configuration
| Object
| Object
[Build & Test/build-7]   ✅  Success - Main Matrix Configuration
[Build & Test/build-5]   ✅  Success - Main Matrix Configuration
[Build & Test/build-6] Cleaning up container for job build
[Build & Test/build-7] Cleaning up container for job build
[Build & Test/build-5] Cleaning up container for job build
[Build & Test/build-6] 🏁  Job succeeded
[Build & Test/build-7] 🏁  Job succeeded
[Build & Test/build-5] 🏁  Job succeeded

Additional information

No response

@jaraco
Copy link

jaraco commented May 10, 2024

I believe I've also encountered a related issue when working on pypa/setuptools#4310, whose config has a distutils factor in the matrix config that is only set on one include. However, when I run this configuration with act --job test --matrix python:3.10 --matrix platform:ubuntu-latest --matrix distutils:stdlib, I get two jobs, one for distutils:stdlib and another for distutils being unset:

[tests/test-1] 🧪  Matrix: map[platform:ubuntu-latest python:3.10]
[tests/test-2] 🧪  Matrix: map[distutils:stdlib platform:ubuntu-latest python:3.10]

Best I can tell, it's not possible to run just the job for distutils:stdlib due to this bug.

act version 0.2.62

act version:            0.2.62
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
	$HOME/.docker/run/docker.sock
Config files:           
	/Users/jaraco/Library/Application Support/act/actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.22.2
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.62
		DefaultGODEBUG:       httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               arm64
		GOOS:                 darwin
Docker Engine:
	Engine version:        26.0.0
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Docker Desktop
	OS type:               linux
	OS version:            
	OS arch:               aarch64
	OS kernel:             6.6.22-linuxkit
	OS CPU:                12
	OS memory:             7840 MB
	Security options:
		name=seccomp,profile=unconfined
		name=cgroupns

I was able to temporarily work around the issue by making the distutils factor explicit in the matrix for the matching value:

 setuptools feature/pep-621 @ git diff
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index ec2e567a1..903c7060c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -53,6 +53,7 @@ jobs:
           platform: ubuntu-latest
         - python: "3.10"
           platform: ubuntu-latest
+          distutils: local
         - python: "3.11"
           platform: ubuntu-latest
         - python: pypy3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants