Skip to content

Commit

Permalink
build: swap new buck audit steps into github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Nov 16, 2023
1 parent c6d7cd8 commit b59354f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/audit.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/buck2-audit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Buck2 test
on:
pull_request:
branches: [main]
types: [opened, synchronize, labeled, unlabeled]

jobs:
buck2-test:
name: Buck2 Test
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: actions/checkout@v3
- name: Prepare Buck2 test args from labels
id: prepare_args
run: |
ARGS=""
cat <<EOF > labels.json
${{ toJSON(github.event.pull_request.labels.*.name) }}
EOF
for LABEL in dashboard consent core; do
case "$LABEL" in
dashboard|consent)
ARGS+=" //apps/$LABEL:audit"
;;
core)
ARGS+=" //core/api:audit"
;;
esac
done
echo "Prepared args: $ARGS"
echo "args=$ARGS" >> "$GITHUB_OUTPUT"
- name: Buck2 test
run: nix develop -c buck2 test ${{ steps.prepare_args.outputs.args }}

0 comments on commit b59354f

Please sign in to comment.