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

Integrate local CI with GitHub Actions #15

Closed
mknorps opened this issue Dec 19, 2022 · 2 comments · Fixed by #23 or #40
Closed

Integrate local CI with GitHub Actions #15

mknorps opened this issue Dec 19, 2022 · 2 comments · Fixed by #23 or #40

Comments

@mknorps
Copy link
Collaborator

mknorps commented Dec 19, 2022

Integrate local “CI” with Github’s CI. Want as few and as simple commands as possible to run locally what will later be run by Github. Make it as easy as possible to reproduce CI failures in our local environments. (Also: Little or no duplication between GH CI and local CI).

@jherland
Copy link
Member

I've been looking at this today, without being able to land it conclusively. #22 has some changes that I think are useful in any case.

I have tried to get act running locally (nix-shell -p act). It requires a working Docker setup, and I finally got it running on podman (a better alternative to Docker) using this command-line:

DOCKER_HOST=unix:///var/run/podman/podman.sock act

Currently it fails all CI actions that are run on any Python version except v3.11. The actions apparently fail while Poetry is trying to install dependencies, but Poetry does not say anything about why. Here is some sample output:

[CI/ci-2]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=
| Creating virtualenv fawltydeps-sotR21sh-py3.9 in /root/.cache/pypoetry/virtualenvs
| Installing dependencies from lock file
| 
| Package operations: 24 installs, 0 updates, 0 removals
| 
[CI/ci-2]   ❌  Failure - Main Install project
[CI/ci-2] exitcode '1': failure
[CI/ci-2] 🏁  Job failed

In addition to this it's quite slow (since it has to run everything in containers). On my Tweag laptop, the first run from scratch took ~3 minutes to fail, and re-running a single failing action takes ~35s. Running a successful action by itself takes ~1m15s.

These are times that (IMHO) are barely acceptable in a CI setting (i.e. waiting for your PR to become "green"), but unacceptable as part of a local debug/development feedback cycle.

As I've mentioned a couple of times, I'm working on an alternative for "local CI" using nix and nox. It's not tested much yet, but I've thrown together a draft PR in #23. That PR is on top of #22, and there is also some more work to be done before that is ready: In addition to the TODOs in noxfile.py, I'd like to refactor the Github CI so that it runs the nox actions. That way we won't have duplicate actions defined in both noxfile.py and .github/workflows/ci.yaml...

@jherland
Copy link
Member

jherland commented Jan 9, 2023

This issue is not fully closed by #23, but rather by #40.

@jherland jherland reopened this Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants