0.2.0 #26
This file contains hidden or 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: | |
| branches: | |
| - "**" | |
| tags-ignore: | |
| - "v*" | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| name: Format & Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 | |
| with: | |
| toolchain: stable | |
| components: clippy, rustfmt | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-check- | |
| - uses: ./.github/actions/rust-quality-gate | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 | |
| with: | |
| toolchain: stable | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-test- | |
| - name: Fetch BridgeConn test fixtures | |
| run: | | |
| git clone --depth 1 https://github.com/Bridgeconn/usfm-grammar.git /tmp/usfm-grammar | |
| mkdir -p crates/usfm3/tests/fixtures/usfm-grammar | |
| cp -r /tmp/usfm-grammar/tests/* crates/usfm3/tests/fixtures/usfm-grammar/ | |
| - name: Run tests | |
| run: cargo test --workspace | |
| wasm-build: | |
| name: WASM Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 | |
| with: | |
| toolchain: stable | |
| targets: wasm32-unknown-unknown | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-wasm-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-wasm- | |
| # Sandbox the wasm-pack installation | |
| - name: Install wasm-pack | |
| run: env -i PATH="$PATH" HOME="$HOME" curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | env -i PATH="$PATH" HOME="$HOME" sh | |
| - name: Build WASM (web) | |
| run: wasm-pack build crates/usfm3-wasm --target web | |
| - name: Build WASM (nodejs) | |
| run: wasm-pack build crates/usfm3-wasm --target nodejs --out-dir pkg-node | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wasm-pkg | |
| path: | | |
| crates/usfm3-wasm/pkg | |
| crates/usfm3-wasm/pkg-node | |
| wasm-type-check: | |
| name: WASM Type Check | |
| needs: wasm-build | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wasm-pkg | |
| path: crates/usfm3-wasm | |
| - name: Install type checking tools | |
| run: npm install -g typescript tsx | |
| - name: Type check (tsc) | |
| run: tsc --noEmit --strict --skipLibCheck --moduleResolution bundler --module esnext crates/usfm3-wasm/type-check-runtime.ts | |
| - name: Type check (runtime) | |
| run: tsx crates/usfm3-wasm/type-check-runtime.ts |