Skip to content

fix: validate rootDir and outDir compatibility with rules_ts #2709

fix: validate rootDir and outDir compatibility with rules_ts

fix: validate rootDir and outDir compatibility with rules_ts #2709

Workflow file for this run

name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main, 2.x, 3.x]
pull_request:
branches: [main, 2.x, 3.x]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
# Cancel previous actions from the same PR or branch except 'main' branch.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
test:
# Only run on main branch (not PRs) to minimize minutes (billed at 10X and 2X respectively)
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
if: github.ref_name == 'main' || contains(github.head_ref, 'macos') || contains(github.head_ref, 'windows')
strategy:
fail-fast: false
matrix:
folder:
- .
- examples
- 'e2e/smoke'
- 'e2e/smoke_rjs3'
os:
# NB: linux testing is on Aspect Workflows
- macos-latest
# Broken by rules_multitool, among others
# - windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: bazel-contrib/setup-bazel@0.18.0
with:
bazelisk-cache: true
external-cache: true
module-root: ${{ matrix.folder }}
- run: bazel test //...
bats-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v3
with:
# pnpm 7 does not work with latest node 20
node-version: 19
- uses: pnpm/action-setup@v2
with:
version: '7.14.2'
- name: Setup bats
uses: mig4/setup-bats@v1
with:
bats-version: '1.8.2'
- name: Setup bats helpers
uses: brokenpip3/setup-bats-libs@0.0.3
with:
support-path: /usr/lib/bats/bats-support
support-version: '0.3.0'
assert-path: /usr/lib/bats/bats-assert
assert-version: '2.1.0'
- name: bats -r .
working-directory: e2e/test
run: |
echo "import $GITHUB_WORKSPACE/.github/workflows/ci.bazelrc" > .bazelrc
bats -r .
# For branch protection settings, this job provides a "stable" name that can be used to gate PR merges
# on "all matrix jobs were successful".
conclusion:
needs: [test, bats-tests]
runs-on: ubuntu-latest
if: always()
steps:
- run: |
if [[ "${{ needs.bats-tests.result }}" == "success" && ("${{ needs.test.result }}" == "success" || "${{ needs.test.result }}" == "skipped") ]]; then
exit 0
else
exit 1
fi