Skip to content

0.20.0

0.20.0 #396

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
tags: '*'
branches: [main]
jobs:
build:
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
kind: test_release
- os: ubuntu-latest
kind: test_debug
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: denoland/setup-deno@v1
- name: Ensure code generation same
if: matrix.config.kind == 'test_debug'
run: |
cargo install cargo-clone --version 1.2.1 --locked
chmod +x ./scripts/generate.ts
./scripts/generate.ts
echo Checking for git changes...
git diff --no-ext-diff --exit-code
- name: Build debug
if: matrix.config.kind == 'test_debug'
run: cargo build
- name: Clippy
if: matrix.config.kind == 'test_debug'
run: cargo clippy --all-features
- name: Test debug
if: matrix.config.kind == 'test_debug'
run: cargo test --all-features
- name: Build release
if: matrix.config.kind == 'test_release'
run: cargo build --release --all-features
- name: Test release
if: matrix.config.kind == 'test_release'
run: cargo test --release --all-features
- name: Publish
if: |
matrix.config.kind == 'test_release' &&
github.repository == 'dprint/dprint-swc-ext' &&
startsWith(github.ref, 'refs/tags/')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
run: cd rs-lib && cargo +stable publish -p dprint-swc-ext