Add act support #30

Merged
Hoverbear merged 15 commits from hoverbear/ds-980-act-support into main 2023-07-01 20:59:30 +00:00
Hoverbear commented 2023-06-28 17:57:06 +00:00 (Migrated from github.com)
Description

Add Act support.

Checklist
  • Tested changes against a test repository
  • Added or updated relevant documentation (leave unchecked if not applicable)
  • (If this PR is for a release) Updated README to point to the new tag (leave unchecked if not applicable)
##### Description Add Act support. ##### Checklist - [ ] Tested changes against a test repository - [ ] Added or updated relevant documentation (leave unchecked if not applicable) - [ ] (If this PR is for a release) Updated README to point to the new tag (leave unchecked if not applicable)
Hoverbear commented 2023-06-28 18:09:48 +00:00 (Migrated from github.com)

image

![image](https://github.com/DeterminateSystems/nix-installer-action/assets/130903/52cba97b-31de-4115-b111-1d69a5150ba7)
cole-h (Migrated from github.com) approved these changes 2023-06-28 20:41:53 +00:00
cole-h (Migrated from github.com) left a comment

Else LGTM, but I don't use ACT so I can't test it.

Else LGTM, but I don't use ACT so I can't test it.
cole-h (Migrated from github.com) commented 2023-06-28 20:40:42 +00:00

I think

```suggestion ``` I think
Hoverbear (Migrated from github.com) reviewed 2023-06-28 20:43:47 +00:00
Hoverbear (Migrated from github.com) commented 2023-06-28 20:43:47 +00:00

Ah ya...

Ah ya...
Hoverbear commented 2023-06-28 20:44:14 +00:00 (Migrated from github.com)

@cole-h I was able to run nix run nixpkgs#act in the directory if I had services.docker.enable set.

@cole-h I was able to run `nix run nixpkgs#act` in the directory if I had `services.docker.enable` set.
lheckemann (Migrated from github.com) approved these changes 2023-06-30 14:07:53 +00:00
lheckemann commented 2023-06-30 14:52:14 +00:00 (Migrated from github.com)

Changes LGTM but it doesn't actuallly work for me:


[linus@oak:~/scratch/nix-installer-action]$ nix run nixpkgs#act
[CI/Run x86_64 Linux ] 🚀  Start image=node:16-bullseye-slim
[CI/Run x86_64 Darwin] 🚧  Skipping unsupported platform -- Try running with `-P macos-12=...`
[CI/Run x86_64 Linux ]   🐳  docker pull image=node:16-bullseye-slim platform= username= forcePull=true
[CI/Run x86_64 Linux ]   🐳  docker create image=node:16-bullseye-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[CI/Run x86_64 Linux ]   🐳  docker run image=node:16-bullseye-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[CI/Run x86_64 Linux ] ⭐ Run Main actions/checkout@v3
[CI/Run x86_64 Linux ]   🐳  docker cp src=/home/linus/scratch/nix-installer-action/. dst=/home/linus/scratch/nix-installer-action
[CI/Run x86_64 Linux ]   ✅  Success - Main actions/checkout@v3
[CI/Run x86_64 Linux ] ⭐ Run Main Install Nix
[CI/Run x86_64 Linux ] ⭐ Run Main Install Nix
[CI/Run x86_64 Linux ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir=
| Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This
 will change the settings of the `init` as well as `extra-conf` to be compatible with `act`
| Set NIX_INSTALLER_EXTRA_CONF=sandbox = false
| trusted-users = root
| Set NIX_INSTALLER_URL=https://install.determinate.systems/nix/branch/main
| Set NIX_INSTALLER_LOGGER=pretty
| Set NIX_INSTALLER_LOG_DIRECTIVES=nix_installer=trace
| Set RUST_BACKTRACE=full
| Set NIX_INSTALLER_DIAGNOSTIC_ENDPOINT=https://install.determinate.systems/nix/diagnostic
| Set NIX_INSTALLER_NO_CONFIRM=true
| /var/run/act/workflow/1-composite-0.sh: line 208: curl: command not found
[CI/Run x86_64 Linux ]   ❌  Failure - Main Install Nix
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ]   ❌  Failure - Main Install Nix
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ] ⭐ Run Main Test `nix` with `$GITHUB_PATH`
[CI/Run x86_64 Linux ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
| /var/run/act/workflow/3: line 2: nix: command not found
[CI/Run x86_64 Linux ]   ❌  Failure - Main Test `nix` with `$GITHUB_PATH`
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ] ⭐ Run Main Test bash
[CI/Run x86_64 Linux ]   🐳  docker exec cmd=[bash --login /var/run/act/workflow/4] user= workdir=
| /var/run/act/workflow/4: line 2: nix-instantiate: command not found
[CI/Run x86_64 Linux ]   ❌  Failure - Main Test bash
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ] ⭐ Run Main Test sh
[CI/Run x86_64 Linux ]   🐳  docker exec cmd=[sh -l /var/run/act/workflow/5] user= workdir=
| /var/run/act/workflow/5: 2: nix-instantiate: not found
[CI/Run x86_64 Linux ]   ❌  Failure - Main Test sh
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ] ⭐ Run Main Test `nix` with `$GITHUB_PATH`
[CI/Run x86_64 Linux ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/7] user= workdir=
| /var/run/act/workflow/7: line 2: nix: command not found
[CI/Run x86_64 Linux ]   ❌  Failure - Main Test `nix` with `$GITHUB_PATH`
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ] ⭐ Run Main Test `nix` with `$GITHUB_PATH`
[CI/Run x86_64 Linux ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/9] user= workdir=
| /var/run/act/workflow/9: line 2: nix: command not found
[CI/Run x86_64 Linux ]   ❌  Failure - Main Test `nix` with `$GITHUB_PATH`
[CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
[CI/Run x86_64 Linux ] ⭐ Run Post Install Nix
[CI/Run x86_64 Linux ]   ✅  Success - Post Install Nix
[CI/Run x86_64 Linux ] 🏁  Job failed
Error: Job 'Run x86_64 Linux' failed

am I doing a stupid here?

Changes LGTM but it doesn't actuallly work for me: ``` [linus@oak:~/scratch/nix-installer-action]$ nix run nixpkgs#act [CI/Run x86_64 Linux ] 🚀 Start image=node:16-bullseye-slim [CI/Run x86_64 Darwin] 🚧 Skipping unsupported platform -- Try running with `-P macos-12=...` [CI/Run x86_64 Linux ] 🐳 docker pull image=node:16-bullseye-slim platform= username= forcePull=true [CI/Run x86_64 Linux ] 🐳 docker create image=node:16-bullseye-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [CI/Run x86_64 Linux ] 🐳 docker run image=node:16-bullseye-slim platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [CI/Run x86_64 Linux ] ⭐ Run Main actions/checkout@v3 [CI/Run x86_64 Linux ] 🐳 docker cp src=/home/linus/scratch/nix-installer-action/. dst=/home/linus/scratch/nix-installer-action [CI/Run x86_64 Linux ] ✅ Success - Main actions/checkout@v3 [CI/Run x86_64 Linux ] ⭐ Run Main Install Nix [CI/Run x86_64 Linux ] ⭐ Run Main Install Nix [CI/Run x86_64 Linux ] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir= | Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the settings of the `init` as well as `extra-conf` to be compatible with `act` | Set NIX_INSTALLER_EXTRA_CONF=sandbox = false | trusted-users = root | Set NIX_INSTALLER_URL=https://install.determinate.systems/nix/branch/main | Set NIX_INSTALLER_LOGGER=pretty | Set NIX_INSTALLER_LOG_DIRECTIVES=nix_installer=trace | Set RUST_BACKTRACE=full | Set NIX_INSTALLER_DIAGNOSTIC_ENDPOINT=https://install.determinate.systems/nix/diagnostic | Set NIX_INSTALLER_NO_CONFIRM=true | /var/run/act/workflow/1-composite-0.sh: line 208: curl: command not found [CI/Run x86_64 Linux ] ❌ Failure - Main Install Nix [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ❌ Failure - Main Install Nix [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ⭐ Run Main Test `nix` with `$GITHUB_PATH` [CI/Run x86_64 Linux ] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= | /var/run/act/workflow/3: line 2: nix: command not found [CI/Run x86_64 Linux ] ❌ Failure - Main Test `nix` with `$GITHUB_PATH` [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ⭐ Run Main Test bash [CI/Run x86_64 Linux ] 🐳 docker exec cmd=[bash --login /var/run/act/workflow/4] user= workdir= | /var/run/act/workflow/4: line 2: nix-instantiate: command not found [CI/Run x86_64 Linux ] ❌ Failure - Main Test bash [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ⭐ Run Main Test sh [CI/Run x86_64 Linux ] 🐳 docker exec cmd=[sh -l /var/run/act/workflow/5] user= workdir= | /var/run/act/workflow/5: 2: nix-instantiate: not found [CI/Run x86_64 Linux ] ❌ Failure - Main Test sh [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ⭐ Run Main Test `nix` with `$GITHUB_PATH` [CI/Run x86_64 Linux ] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/7] user= workdir= | /var/run/act/workflow/7: line 2: nix: command not found [CI/Run x86_64 Linux ] ❌ Failure - Main Test `nix` with `$GITHUB_PATH` [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ⭐ Run Main Test `nix` with `$GITHUB_PATH` [CI/Run x86_64 Linux ] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/9] user= workdir= | /var/run/act/workflow/9: line 2: nix: command not found [CI/Run x86_64 Linux ] ❌ Failure - Main Test `nix` with `$GITHUB_PATH` [CI/Run x86_64 Linux ] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information [CI/Run x86_64 Linux ] ⭐ Run Post Install Nix [CI/Run x86_64 Linux ] ✅ Success - Post Install Nix [CI/Run x86_64 Linux ] 🏁 Job failed Error: Job 'Run x86_64 Linux' failed ``` am I doing a stupid here?
Hoverbear commented 2023-06-30 16:17:52 +00:00 (Migrated from github.com)

I don't think you are!

I don't think you are!
Hoverbear commented 2023-06-30 17:20:34 +00:00 (Migrated from github.com)

@lheckemann I think I found the problem and it's working locally for me now. Can you try again?

@lheckemann I think I found the problem and it's working locally for me now. Can you try again?
lheckemann commented 2023-06-30 17:36:13 +00:00 (Migrated from github.com)

Still getting the same thing :/

Still getting the same thing :/
Hoverbear commented 2023-06-30 18:48:52 +00:00 (Migrated from github.com)

I don't understand how your image has no curl and mine does...

I don't understand how your image has no curl and mine does...
Hoverbear commented 2023-06-30 18:49:24 +00:00 (Migrated from github.com)

Why does yours pull docker pull image=node:16-bullseye-slim?

Why does yours pull `docker pull image=node:16-bullseye-slim`?
lheckemann commented 2023-06-30 19:03:41 +00:00 (Migrated from github.com)

I have no idea :D what does yours use?

I have no idea :D what does yours use?
Hoverbear commented 2023-06-30 19:35:54 +00:00 (Migrated from github.com)
❯ sudo nix run nixpkgs#act
[CI/Run x86_64 Darwin] 🚧  Skipping unsupported platform -- Try running with `-P macos-12=...`
[CI/Run x86_64 Linux ] 🚀  Start image=catthehacker/ubuntu:act-22.04
[CI/Run x86_64 Linux ]   🐳  docker pull image=catthehacker/ubuntu:act-22.04 platform= username= forcePull=true
[CI/Run x86_64 Linux ]   🐳  docker create image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[CI/Run x86_64 Linux ]   🐳  docker run image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]

I assume our .actrc are different: https://github.com/nektos/act#first-act-run

❯ cat ~/.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
``` ❯ sudo nix run nixpkgs#act [CI/Run x86_64 Darwin] 🚧 Skipping unsupported platform -- Try running with `-P macos-12=...` [CI/Run x86_64 Linux ] 🚀 Start image=catthehacker/ubuntu:act-22.04 [CI/Run x86_64 Linux ] 🐳 docker pull image=catthehacker/ubuntu:act-22.04 platform= username= forcePull=true [CI/Run x86_64 Linux ] 🐳 docker create image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [CI/Run x86_64 Linux ] 🐳 docker run image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] ``` I assume our `.actrc` are different: https://github.com/nektos/act#first-act-run ``` ❯ cat ~/.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 ```
lheckemann commented 2023-07-01 20:59:07 +00:00 (Migrated from github.com)

Aaah yes, using the nixos-unstable branch of nixpkgs (was using 23.05 before) after removing actrc does the trick!

Aaah yes, using the nixos-unstable branch of nixpkgs (was using 23.05 before) after removing actrc does the trick!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix-install-action#30
No description provided.