Revert "Upgades TypeScript to 5.4.5." #495
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of Node dependencies and execute all | |
# Bazel tests. This implicitly builds all required targets. Any target that is | |
# not tested but should verify its build should use a build test. | |
# https://github.com/bazelbuild/bazel-skylib/blob/master/rules/build_test.bzl | |
name: CI | |
on: | |
push: | |
branches: | |
# Run CI for direct pushes to `main`. I probably shouldn't do that in | |
# general, but for a core team of 1, PRs are a waste of effort. | |
- main | |
# Run CI for the `ci` branch. This branch isn't special in any way, it | |
# just does not enforce linear history, so edits to the CI workflow can be | |
# tested there where commits can still be amended before they are | |
# immutably pushed to main. | |
- ci | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
# Includes `bazelisk`. | |
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#:~:text=Bazel%204.2.1-,Bazelisk,-1.10.1 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Bazel | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }} | |
restore-keys: | | |
${{ runner.os }}-bazel- | |
- name: Get pnpm store directory | |
id: pnpm-cache-dir | |
run: | | |
echo "PNPM_STORE_PATH=$(bazel run @pnpm --config ci --config incompatible -- store path --silent)" >> "${GITHUB_OUTPUT}" | |
- name: Cache pnpm | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache-dir.outputs.PNPM_STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install | |
run: bazel run @pnpm --config ci --config incompatible -- install --dir $PWD --frozen-lockfile | |
# Build and test the entire repository. Include all supported | |
# `--incompatible_*` flags to avoid regressions. | |
- name: Test | |
run: | | |
# Run `bazel test //...` over all workspaces in the repository. | |
find . -name WORKSPACE.bazel -printf "%h\n" | | |
sort | | |
xargs -I {} bash -c "(cd {} && bazel test //... --config ci --config incompatible)" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bazel.profile.gz | |
path: bazel.profile.gz | |
docs-deploy: | |
# Includes `bazelisk`. | |
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#:~:text=Bazel%204.2.1-,Bazelisk,-1.10.1 | |
runs-on: ubuntu-20.04 | |
# Only deploy after a successful test run. | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Bazel | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }} | |
restore-keys: | | |
${{ runner.os }}-bazel- | |
- name: Get pnpm store directory | |
id: pnpm-cache-dir | |
run: | | |
echo "PNPM_STORE_PATH=$(bazel run @pnpm --config ci --config incompatible -- store path --silent)" >> "${GITHUB_OUTPUT}" | |
- name: Cache pnpm | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-cache-dir.outputs.PNPM_STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install | |
run: bazel run @pnpm --config ci --config incompatible -- install --dir $PWD --frozen-lockfile | |
- name: Deploy to preview | |
# Only publish non-`main` branch for preview. | |
if: ${{ github.ref_name != 'main' }} | |
run: | | |
bazel run //docs:deploy --config ci --config incompatible -- \ | |
--alias ${{ github.ref_name }} \ | |
-m "Automated preview deployment from GitHub actions." | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.DOCS_NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PAT }} | |
- name: Deploy to Prod | |
# Only publish the `main` branch to prod. | |
if: ${{ github.ref_name == 'main' }} | |
run: | | |
bazel run //docs:deploy --config ci --config incompatible -- \ | |
--prod \ | |
-m "Automated prod deployment from GitHub actions." | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.DOCS_NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PAT }} |