Skip to content

Commit

Permalink
build: add separate build args for check action
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Feb 9, 2024
1 parent e9cdb21 commit 4e2c1ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/check-code-and-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
id: prepare_args
run: |
ARGS=""
BUILD_ARGS=""
cat <<EOF > labels.json
${{ toJSON(github.event.pull_request.labels.*.name) }}
Expand All @@ -40,21 +41,26 @@ jobs:
case "$LABEL" in
dashboard|consent|pay|admin-panel|map)
ARGS+=" //apps/$LABEL:test"
BUILD_ARGS+=" //apps/$LABEL:node_modules"
;;
core)
ARGS+=" //core/api:test"
BUILD_ARGS+=" //core/api:prod_build"
;;
api-keys|notifications)
ARGS+=" //core/$LABEL:$LABEL"
BUILD_ARGS+=" //core/$LABEL:$LABEL"
;;
esac
done
echo "Prepared args: $ARGS"
echo "Prepared build_args: $BUILD_ARGS"
echo "args=$ARGS" >> "$GITHUB_OUTPUT"
echo "build_args=$BUILD_ARGS" >> "$GITHUB_OUTPUT"
- name: Build via buck2
if: steps.prepare_args.outputs.args != ''
run: nix develop -c buck2 build ${{ steps.prepare_args.outputs.args }}
run: nix develop -c buck2 build ${{ steps.prepare_args.outputs.build_args }}
- name: Run checks and tests via buck2
if: steps.prepare_args.outputs.args != ''
run: nix develop -c buck2 test ${{ steps.prepare_args.outputs.args }}

0 comments on commit 4e2c1ff

Please sign in to comment.