[[act]]を使って[[GitHub Actions]]をローカル実行してみる。 ## 対象リポジトリ [[🦉Another Quick Switcher]]を使う。 ## [[act]]インストール [[Scoop]]を使う。 ```console scoop install act ``` ## [[Rancher Desktop]]を起動 [[Docker Desktop]]はインストールしていないので代わりに[[Rancher Desktop]]を使う。 ## 実行可能一覧 `act -l`で実行可能な情報一覧が確認できる。 ```console $ act -l Stage Job ID Job name Workflow name Workflow file Events 0 release release Release release.yaml push 0 test test Tests tests.yaml push,schedule 1 notify notify Release release.yaml push 1 notify notify Tests tests.yaml push,schedule ``` ## [[act]]を実行 https://github.com/nektos/act#secrets ```console act -W .github/workflows/tests.yaml -s DISCORD_WEBHOOK=<WEBHOOK URL> ``` - `test.yaml`のみを対象にしたいので `-W` オプションで指定 - [[Discord]]への送信に秘密情報が必要なので `-s` オプションで指定 > [!note] > `npm install`だけ長い。毎回真面目にインストールしているから。ローカルだと通信量が気になるかも...。クリーンな確認をしたいならそれは仕方ない。 コンテナイメージは`catthehacker/ubuntu`が利用され、サイズは1.16GBだった。