feat: add token span info, fixes #1 and #13 #68
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: Continuous Integration | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- release/* | |
tags: | |
- v* | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
conformance-rust: | |
name: Conformance Rust | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache Rust | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-nightly-${{ hashFiles('Cargo.toml') }} | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt, clippy | |
override: true | |
- name: Rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --check | |
- name: Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- --deny warnings | |
conformance-ts: | |
name: Conformance TypeScript | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
- name: Install Dependencies | |
run: cd bindings/typescript && npm install | |
- name: Eslint | |
run: cd bindings/typescript && npm run lint | |
- name: Prettier | |
run: cd bindings/typescript && npm run format:check | |
test-rust: | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- macos-latest | |
- ubuntu-latest | |
name: Test Rust (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache Rust | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.toml') }} | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Test Rust | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
publish-crates-io: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [ conformance-rust, test-rust ] | |
name: Publish to Crates.io | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Publish | |
run: cargo publish --token ${REGISTRY_TOKEN} | |
env: | |
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} | |
publish-npm: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [ conformance-rust, test-rust ] | |
name: Publish to NPM | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
- name: Install Dependencies | |
run: cd bindings/typescript && npm install | |
- name: Build | |
run: cd bindings/typescript && npm run build | |
- name: Publish | |
run: cd bindings/typescript && npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |