Skip to content

Commit 60db14d

Browse files
committed
run GitHub actions locally using gh act
1 parent 6695bec commit 60db14d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/doc/en/developer/github.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,33 @@ and check::
7373

7474
which will show the default repo along with its readme, which is quite long.
7575

76+
Framework for testing GitHub Actions locally
77+
--------------------------------------------
78+
79+
A useful extension to ``gh`` allows testing of Sage's GitHub Actions locally,
80+
using Docker. It is called ``act`` and can be installed as a ``gh extension``::
81+
82+
[alice@localhost sage]$ gh extension install https://github.com/nektos/gh-act
83+
84+
Extra steps needed for configuration of Docker to run Actions locally can be found on
85+
`act's GitHub <https://github.com/nektos/act>`_
86+
87+
After it's set up, one can e.g. list all the available actions::
88+
89+
[alice@localhost sage]$ gh act -l
90+
Stage Job ID Job name Workflow name Workflow file Events
91+
0 build build Build & Test build.yml workflow_dispatch,pull_request,push
92+
0 test Conda Build & Test using Conda ci-conda.yml push,pull_request,workflow_dispatch
93+
0 cygwin-stage-i-b cygwin-stage-i-b CI cygwin-standard ci-cygwin-standard.yml push,workflow_dispatch
94+
[...]
95+
96+
run a particular action ``foobar`` ::
97+
98+
[alice@localhost sage]$ gh act -j foobar
99+
...
100+
101+
and so on.
102+
76103

77104
Linking Git to your GitHub account
78105
==================================

0 commit comments

Comments
 (0)