Passez à l'act(-ion) !

Simulez vos GitHub Actions sur votre machine locale avec nektos/act

@stlgaits

nektos/act

https://nektosact.com

Simulez vos GitHub Actions sur votre machine locale avec nektos/act

Actions GitHub : intégration continue.

{{#}}

{{#}}

@stlgaits

Contexte

 

ajouter les premiers tests fonctionnels

{{#}}

@stlgaits

Simulez vos GitHub Actions sur votre machine locale avec nektos/act

@stlgaits

@stlgaits

{{#}}

@stlgaits

{{#}}

nektos/act

{{#}}

@stlgaits

Task runner pour simuler son workflow GitHub Actions en local

API Docker

  • pull et build images
  • lancer les containers
  • exécuter vos workflows
https://nektosact.com

Installer

{{#}}

@stlgaits

NB: il vous faut Docker Engine API

pacman -Syu act
https://nektosact.com

Installer

{{#}}

@stlgaits

NB: il vous faut Docker Engine API

scoop install act
https://nektosact.com
winget install netkos.act
brew install act

fichier .secrets

{{#}}

@stlgaits

GITHUB_TOKEN=ghp_<GH_token_perso>
PACKAGIST_TOKEN=<packagist_token_du_projet>
https://nektosact.com

Attention à ne pas TOUT jouer

{{#}}

@stlgaits

Par défaut, mode YOLO...

act
  • tous les workflows dans .github/workflow
  • tous les events push
  • tous les jobs
https://nektosact.com
push

Jouer un job en particulier

{{#}}

@stlgaits

act -j test
act -j checks --env-file .env.local 
https://nektosact.com

Jouer un job en particulier

{{#}}

@stlgaits

https://nektosact.com

Jouer une matrice

{{#}}

@stlgaits

act -j checks --matrix check:phpunit
act -j checks --matrix check:phpstan
act -j checks --matrix node:8
https://nektosact.com
https://nektosact.com

Merci.

{{#}}

@stlgaits

https://nektosact.com

https://github.com/cplee/github-actions-demo

Passez à l'act-ion avec nektos/act! - ForumPHP 2026

By Estelle Gaits

Passez à l'act-ion avec nektos/act! - ForumPHP 2026

Time to act! Simulate your GitHub Action CI runs on your local machine with nektos/act Writing the perfect CI workflow in one shot is (for mere mortals like us anyway) basically impossible. Ever tried to setup your testing environment jobs, pushed to GitHub, wait for CI run to fail, read feedback, made some minor change, pushed, rinsed and repeated? What happens when your CI run takes dozens of minutes to execute each time? Surely that loop can go from cumbersome to nightmar-ish in actual large production projects. Luckily, incredible open source tools allow us to simulate complete or parts of CI runs on our local dev machine, hence saving precious time and frustration along the way. We will explore how, using nektos/act, you can drastically improve your development speed by running GitHub Actions directly on your computer without crashing everyone else's pipeline.

  • 52