Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ jobs:
test:
name: Build and test
runs-on: ubuntu-latest
with:
fetch-depth: 0

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint and format
uses: gcr.io/cloud-builders/bazel@sha256:aa6c5ffd0d6d37960715d9c3392ba885e6484322c81c3604a90ccfb15c07c110
entrypoint: bash
with:
args: ./scripts/lint


- name: Run unit tests
# 7.3.2
uses: gcr.io/cloud-builders/bazel@sha256:aa6c5ffd0d6d37960715d9c3392ba885e6484322c81c3604a90ccfb15c07c110
Expand Down
8 changes: 8 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
set -e

bazel run @nodejs//:yarn

# Run eslint.
bazel build @npm//eslint/bin:eslint && bazel-bin/external/npm/eslint/bin/eslint.sh --rulesdir eslint-rules '**/*.ts'

# Run prettier on .ts files changed against origin/main
CHANGED_TS_FILES=$(git diff --name-only --diff-filter=ACMR origin/main...HEAD -- '*.ts')

if [ -n "$CHANGED_TS_FILES" ]; then
bazel build @npm//prettier/bin:prettier && bazel-bin/external/npm/prettier/bin/prettier.sh --ignore-path .eslintignore --check $CHANGED_TS_FILES
fi