Skip to content

Commit

Permalink
ci: pass labels to tilt
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Oct 25, 2023
1 parent 058bff6 commit 189c941
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/tilt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Tilt CI"
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, labeled, unlabeled]

jobs:
tests:
runs-on: ubuntu-latest
Expand All @@ -10,5 +12,21 @@ jobs:
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare tilt args from labels
id: prepare_args
run: |
ARGS=""
cat <<EOF > labels.json
${{ toJSON(github.event.pull_request.labels.*.name) }}
EOF
for LABEL in $(jq -r '.[]' < labels.json); do
case "$LABEL" in
dashboard|consent)
ARGS+=" $LABEL"
;;
esac
done
echo "Prepared args: $ARGS"
echo "args=$ARGS" >> "$GITHUB_OUTPUT"
- name: Tilt CI
run: nix develop -c bash -c "cd dev && xvfb-run tilt ci -- --test consent"
run: nix develop -c bash -c "cd dev && xvfb-run tilt ci -- --test ${{ steps.prepare_args.outputs.args }}"

0 comments on commit 189c941

Please sign in to comment.