fix(deps): update rust crate yansi to v1 #3430
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
# Workflow for running linting, tests, and other checks | |
# | |
# Detects where file changes occur so that the main Rust-based job | |
# (which takes up to 30 mins) is only run when there are related changes | |
# (and not when the `web` module changes for example). | |
# | |
# Tries to take a fail fast approach : dependency audits, linting etc, | |
# (which are faster), are run before tests (which are slower, particularly | |
# for Rust-based modules including the Node and Pythn SDKs). | |
name: Test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
RUST_VERSION: "1.76.0" | |
CARGO_TERM_COLOR: always | |
NODE_VERSION: "20" | |
PYTHON_VERSION: "3.11" | |
jobs: | |
# Detect which folders have changes | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
main: ${{ steps.changes.outputs.main }} | |
ts: ${{ steps.changes.outputs.ts }} | |
web: ${{ steps.changes.outputs.web }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Detect changes | |
uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
main: | |
- 'node/**' | |
- 'python/**' | |
- 'rust/**' | |
ts: | |
- 'ts/**' | |
- 'package.json' | |
vscode: | |
- 'vscode/**' | |
web: | |
- 'web/**' | |
- 'package.json' | |
main: | |
runs-on: ubuntu-latest-m | |
needs: changes | |
if: needs.changes.outputs.main == 'true' | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
# Skip because on `ubuntu-latest-m` seems to be detrimental | |
if: false | |
with: | |
root-reserve-mb: "4096" | |
remove-dotnet: "true" | |
remove-android: "true" | |
remove-haskell: "true" | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: clippy,rustfmt,llvm-tools | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Setup Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install onnxruntime.so | |
run: ./scripts/install-onnxruntime.sh | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Setup Python dev dependencies | |
run: pip install pdm ruff pyright | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Setup Chrome | |
uses: browser-actions/setup-chrome@v1 | |
- run: which chrome | |
- name: Show disk usage | |
run: df -h && du -hd1 | |
- name: Install dependencies | |
run: make install | |
- name: Run dependency audits | |
run: make audit | |
- name: Run package publishing checks | |
run: make pubcheck | |
- name: Run linting | |
run: make lint | |
- name: Run tests with coverage | |
run: make cover | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
verbose: true | |
- name: Run accessibility checks | |
run: make a11y | |
- name: Make generated files | |
run: make generated | |
- name: Pull branch before commit | |
if: github.ref == 'refs/heads/main' | |
run: git pull origin main | |
- name: Commit generated files | |
if: github.ref == 'refs/heads/main' | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore(*): update generated files" | |
- name: Show disk usage | |
run: df -h && du -hd1 | |
ts: | |
runs-on: ubuntu-latest | |
needs: changes | |
if: needs.changes.outputs.ts == 'true' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: make -C ts install | |
- name: Run dependency audit and publishing checks | |
run: make -C ts audit pubcheck | |
- name: Run linting | |
run: make -C ts lint | |
- name: Run tests | |
run: make -C ts test | |
vscode: | |
strategy: | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
runs-on: ${{ matrix.os }} | |
needs: changes | |
if: needs.changes.outputs.vscode == 'true' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm test | |
if: runner.os != 'Linux' | |
- name: Test with xvfb | |
run: xvfb-run -a npm test | |
if: runner.os == 'Linux' | |
web: | |
runs-on: ubuntu-latest | |
needs: changes | |
if: needs.changes.outputs.web == 'true' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: make -C web install | |
- name: Run dependency audit | |
run: make -C web audit | |
- name: Run linting | |
run: make -C web lint | |
- name: Run tests | |
run: make -C web test |