mirror of
https://github.com/gradle/actions
synced 2024-11-23 18:02:13 +00:00
Make it easier to run workflows locally with 'act'
This commit is contained in:
parent
ea328a863d
commit
33741bd2bb
2 changed files with 19 additions and 5 deletions
1
.github/actions/init-integ-test/action.yml
vendored
1
.github/actions/init-integ-test/action.yml
vendored
|
@ -11,6 +11,7 @@ runs:
|
|||
|
||||
# Downloads a 'dist' directory artifact that was uploaded in an earlier 'build-dist' step
|
||||
- name: Download dist
|
||||
if: ${{ !env.ACT }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
|
|
23
build
23
build
|
@ -3,8 +3,21 @@
|
|||
cd sources
|
||||
npm install
|
||||
|
||||
if [ "$1" == "all" ]; then
|
||||
npm run all
|
||||
else
|
||||
npm run build
|
||||
fi
|
||||
case "$1" in
|
||||
all)
|
||||
nprm run all
|
||||
;;
|
||||
act)
|
||||
# Build and copy outputs to the dist directory
|
||||
npm run build
|
||||
cd ..
|
||||
cp -r sources/dist .
|
||||
# Run act
|
||||
$@
|
||||
# Revert the changes to the dist directory
|
||||
git co -- dist
|
||||
;;
|
||||
*)
|
||||
npm run build
|
||||
;;
|
||||
esac
|
Loading…
Reference in a new issue