News for hackers. Stuff that matters.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by Waterluvian on Thursday April 15, 2021 @01:56PM (#26823924)
Am I missing something obvious or do these kinds of systems lack a good story for testing?

With Travis and now GH Actions I find the fastest way to develop is to just push countless commits and incrementally develop my work flow in a live-ish way while asking peers to ignore the email spam on failures.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by jka on Thursday April 15, 2021 @02:24PM (#26824317)
This project may be able to help you out: https://github.com/nektos/act/ (it provides a way to run GitHub actions locally)
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by thamer on Thursday April 15, 2021 @03:53PM (#26825367)
I've tried to get `act` to work several times over the past few months, and never managed to get even a basic workflow to run locally. It kept giving cryptic errors that I had to dig into their code to figure out (e.g. requiring a GitHub Personal Access Token despite not mentioning it in the docs). It gave me the impression that it was far from functional, for now.

I eventually gave up and have been running Actions on GitHub from a branch, merging into the main one once it works.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by dzhiurgis on Thursday April 15, 2021 @08:55PM (#26828061)
How come Github doesn't have this? Just lemme run it locally. I've wasted so much time debugging my workflows... It's such a obvious miss.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by pydry on Thursday April 15, 2021 @03:13PM (#26824909)
Amazing that somebody developed that for Microsoft.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by madeofpalk on Thursday April 15, 2021 @03:20PM (#26824987)
they probably developed it for themselves.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by Serow225 on Thursday April 15, 2021 @10:45PM (#26828799)
I use this action* to effectively put a 'breakpoint' in a job that lets you SSH in and inspect the env vars, files, refine your shell script code, etc. Cuts way down on the number of CI run/tweak/repeat cycles.

* https://github.com/marketplace/actions/debugging-with-tmate

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by bellttyler on Thursday April 15, 2021 @02:09PM (#26824118)
I do the same. Dozens of commits to get GH Actions working correctly.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by Waterluvian on Thursday April 15, 2021 @04:04PM (#26825472)
I feel far better hearing a few people say they do it the same.

It felt so wrong and amateur and kind of embarrassing.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by hctaw on Thursday April 15, 2021 @04:51PM (#26825966)
It doesn't help the yaml ui/ux is awful.

   - if ${{ github.event_name == 'why do you think this is acceptable?" }}
      run:|
         echo "I need programmatic CI no matter how much you think I don't"
Just let us write our entire pipelines in typescript. People are already using Actions for bitcoin mining, hosting porn, or whatever - if I can do arbitrary shell stuff you're not making my life easier by putting it behind a yaml DSL pretending to be "no code."

If it were just typescript with a reasonable library we could run and debug it locally without jumping through hoops.

/rant

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by dzhiurgis on Thursday April 15, 2021 @08:57PM (#26828074)
I don't get it how Python exists. Even with the best IDE support writing YAML is a misery.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by m45t3r on Thursday April 15, 2021 @10:21PM (#26828644)
I write Python for years (including messing code) and never feel the pain I found when I edit an even a slightly complicated YAML file.

The issue is not really the significant indentation of YAML, it is more of the ambiguity of the syntax plus the fact that YAML is a serialization format so it doesn't have many ways to reduce repetition. Now those issues coupled with the significant indentation makes YAML a mess, but those issues doesn't exist in Python.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by OJFord on Thursday April 15, 2021 @08:30PM (#26827890)
What CI/CD system other than Jenkins uses a configuration format that isn't YAML?
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by hctaw on Thursday April 15, 2021 @09:10PM (#26828173)
Team City. But Jenkins is still king.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by OJFord on Friday April 16, 2021 @12:28PM (#26835929)
I think one either loves it or hates it..
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by detaro on Friday April 16, 2021 @03:14PM (#26837919)
Buildbot
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by kbar13 on Thursday April 15, 2021 @07:03PM (#26827279)
yup and with proper IDE support as well
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by vinceguidry on Thursday April 15, 2021 @09:46PM (#26828430)
I've been making a custom build image in large part because of this. Local testing with Docker isn't the most fun, I have to manually manage the environment variables I pass on the command line, but it's way better than commit then wait for Docker to schedule.

Once it's working locally I push up and it's usually only a commit or two away from working.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by politician on Thursday April 15, 2021 @07:30PM (#26827457)
Countless commits with the same message "flailing" until it works. Typically takes about 30.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by Ayesh on Thursday April 15, 2021 @10:45PM (#26828804)
I suppose we all just brute force it.

For my private projects, I just make it rain with minor incremental improvements, and once it is green, I rebase and squash.

For shared/OS projects, I'd rather fork it and then work on my fork, so I don't trigger emails or other webhooks.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by paxys on Thursday April 15, 2021 @02:09PM (#26824121)
Pushing countless commits is fine as long as you are doing it in your own branch.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by jensvdh on Thursday April 15, 2021 @03:00PM (#26824781)
It's not very cost-effective though.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by paxys on Thursday April 15, 2021 @03:06PM (#26824834)
If CI cost is a problem then test everything locally before pushing.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by amarshall on Thursday April 15, 2021 @04:28PM (#26825719)
…but the point is they’re testing CI itself, which doesn’t exist locally.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by endgame on Thursday April 15, 2021 @10:06PM (#26828549)
Sourcehut at least lets you submit build manifests to builds.sr.ht without having to push, push, push.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by vnglst on Thursday April 15, 2021 @02:18PM (#26824244)
if I remember correctly CircleCI is the only CI-provider that would let you run their pipelines/actions locally in a Docker container. That worked really well for me, quick feedback loop without creating commits.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by mfontani on Thursday April 15, 2021 @04:59PM (#26826044)
Drone CI, too - you can "drone exec" a pipeline and it'll work the same way as on the CI server. It's a great feature to have.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by mdaniel on Thursday April 15, 2021 @04:46PM (#26825910)
I've resorted to running my own local copy of GL (and, of course, its runner) for troubleshooting build complexity, since their runner pool has been so indescribably bad of late: https://status.gitlab.com/pages/history/5b36dc6502d06804c083...

I agree with the other comments that CircleCI is my high-bar for "how can a sane person run the build locally?" because I also agree with the other comments that "act" is handy, but only for the most trivial of hello-world builds, and `gitlab-runner exec` is a cruel joke

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by cbb330 on Thursday April 15, 2021 @04:33PM (#26825773)
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by awwaiid on Thursday April 15, 2021 @08:50PM (#26828034)
Codeship does this too with their `jet` command.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by hctaw on Thursday April 15, 2021 @04:45PM (#26825905)
Haven't found a better way than `./ci.sh` and do as much work as possible to keep github actions/travis/jenkins/whatever from requiring something different than running locally.

It's sisyphean.

Re:Work with GitHub Actions in Your Terminal with GitHub CLI by chatmasta on Thursday April 15, 2021 @06:24PM (#26826918)
In our stack we use a custom CI runner and that's the image we give to gitlab-ci, so it's easy to just test locally. Not sure what the story is with GHA, but generally I try to make sure everything fits into one script so I can just test that. A more fun/hacky option is opening a reverse shell on the CI box. I was even able to get it working through ngrok to my local machine.
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by emerongi on Thursday April 15, 2021 @08:04PM (#26827698)
Maybe you will be interested in https://earthly.dev/
Re:Work with GitHub Actions in Your Terminal with GitHub CLI by flakiness on Friday April 16, 2021 @12:24AM (#26829433)
Cannot this be used for running it with a local change? If no,t what's the point? (Not complaining to you but seriously.)