fix: use wrapper script #3208
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: reflexo::ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - nightly | |
| tags: | |
| - '*' | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: | |
| - main | |
| - nightly | |
| workflow_dispatch: | |
| env: | |
| RUSTFLAGS: '-Dwarnings' | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Checkout test assets | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Myriad-Dreamin/typst | |
| ref: assets-files | |
| path: assets/files | |
| - name: Install Mold | |
| uses: rui314/setup-mold@v1 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: 1.88.0 | |
| components: clippy, rustfmt | |
| target: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash | |
| - name: Install packages | |
| uses: borales/actions-yarn@v4 | |
| with: | |
| cmd: install | |
| - name: Install Playwright | |
| run: yarn playwright install | |
| - name: Fmt check | |
| run: cargo fmt --check --all | |
| # todo: https://github.com/typst/typst/pull/2767 | |
| # --all-features | |
| - name: Clippy check | |
| run: cargo clippy --profile dist --workspace --all-targets | |
| - name: Documentation check | |
| run: cargo doc --profile dist --workspace --no-deps | |
| - name: Build | |
| run: | | |
| cargo build --profile dist --bin typst-ts-dev-server | |
| - name: Build Typescript packages | |
| run: | | |
| yarn run build:pkg | |
| - name: Prepare artifacts | |
| run: yarn run corpus | |
| - name: Test | |
| run: | | |
| cargo test --profile dist --no-fail-fast \ | |
| -p reflexo-typst -p typst-ts-cli | |
| - name: Test Browser | |
| # todo: other package tests | |
| run: cd packages/typst.ts && yarn test | |
| - name: Archive Test Results (WebAssembly Renderer in Chrome) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wasm-renderer-chrome.test_points.json.gz | |
| path: target/typst-artifacts/integrations/renderer/test_points.chrome.json.gz | |
| - name: Archive Test Results (Vitest) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vitest-refs.gz | |
| path: packages/typst.ts/refs | |
| prepare-build: | |
| runs-on: 'ubuntu-latest' | |
| outputs: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: tag # get the tag from package.json | |
| run: echo "tag=v$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT | |
| - name: Show tag | |
| run: echo "Tag is ${{ steps.tag.outputs.tag }}" | |
| announce: | |
| needs: [prepare-build] | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/announce.yml | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| secrets: inherit | |
| with: | |
| tag: ${{ needs.prepare-build.outputs.tag }} | |
| build: | |
| needs: [prepare-build] # , announce | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/release.yml | |
| secrets: inherit | |
| with: | |
| tag: ${{ (startsWith(github.ref, 'refs/tags/') && needs.prepare-build.outputs.tag) || '' }} | |
| targets: ${{ (!startsWith(github.ref, 'refs/tags/') && 'aarch64-apple-darwin,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu') || 'all' }} |