ci(fix): Remove deprecated actions #382
Workflow file for this run
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
name: CI | ||
on: | ||
push: | ||
# Prevent duplicate runs of this workflow on our own internal PRs. | ||
branches: | ||
- main | ||
- next/* | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled] | ||
branches: | ||
- main | ||
- next/* | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true" | ||
jobs: | ||
matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
node_version: ${{ steps.set_matrix.outputs.node_version }} | ||
rust_toolchain: ${{ steps.set_matrix.outputs.rust_toolchain }} | ||
steps: | ||
- name: Set Matrix | ||
id: set_matrix | ||
env: | ||
FULL_NODE_VERSIONS: '["18.x", "20.x", "22.x"]' | ||
FULL_RUST_TOOLCHAINS: '["stable", "nightly"]' | ||
PARTIAL_NODE_VERSIONS: '["22.x"]' | ||
PARTIAL_RUST_TOOLCHAINS: '["stable"]' | ||
HAS_FULL_MATRIX_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'full matrix') }} | ||
IS_PUSHED: ${{ github.event_name == 'push' }} | ||
run: | | ||
if [[ "$HAS_FULL_MATRIX_LABEL" == "true" ]] || [[ "$IS_PUSHED" == "true" ]]; then | ||
echo "node_version=$FULL_NODE_VERSIONS" >> $GITHUB_OUTPUT | ||
echo "rust_toolchain=$FULL_RUST_TOOLCHAINS" >> $GITHUB_OUTPUT | ||
else | ||
echo "node_version=$PARTIAL_NODE_VERSIONS" >> $GITHUB_OUTPUT | ||
echo "rust_toolchain=$PARTIAL_RUST_TOOLCHAINS" >> $GITHUB_OUTPUT | ||
fi | ||
build: | ||
needs: matrix | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: ${{fromJson(needs.matrix.outputs.node_version)}} | ||
rust-toolchain: ${{fromJson(needs.matrix.outputs.rust_toolchain)}} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Use Rust ${{ matrix.rust-toolchain }} | ||
uses: dtolnay/rust-toolchain@${{ matrix.rust-toolchain }} | ||
Check failure on line 57 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
|
||
with: | ||
components: clippy,rustfmt | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
- name: Cache Electron (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ runner.os }}-electron-${{ hashFiles('./package-lock.json') }} | ||
path: ~/.cache/electron | ||
- name: Cache Electron (Windows) | ||
if: matrix.os == 'windows-latest' | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ runner.os }}-electron-${{ hashFiles('./package-lock.json') }} | ||
path: "%LOCALAPPDATA%\\electron\\Cache" | ||
- name: Cache Electron (macOS) | ||
if: matrix.os == 'macos-latest' | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ runner.os }}-electron-${{ hashFiles('./package-lock.json') }} | ||
path: ~/Library/Caches/electron | ||
- name: npm install | ||
run: npm ci --prefer-offline --no-audit --no-fund | ||
- name: Test (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: xvfb-run --auto-servernum npm test -- --nocapture | ||
- name: Test | ||
if: matrix.os != 'ubuntu-latest' | ||
run: npm test |