pub #4279
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: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: moonrepo/setup-rust@v1 | |
with: | |
profile: minimal | |
cache: false | |
inherit-toolchain: true | |
- name: Cache cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v4 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: test | |
run: make test -B # && make vrt -B | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: moonrepo/setup-rust@v1 | |
with: | |
profile: minimal | |
inherit-toolchain: true | |
- name: Cache cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- run: cargo build | |
build-wasm: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
defaults: | |
run: | |
working-directory: ./docx-wasm | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: moonrepo/setup-rust@v1 | |
with: | |
profile: minimal | |
inherit-toolchain: true | |
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- run: rustup target add wasm32-unknown-unknown | |
- run: npm install -g pnpm | |
- run: pnpm install && pnpm wasm-pack:node && pnpm wasm-pack:dev && tsc -p tsconfig.node.json && pnpm test | |
- name: screenshot | |
run: pnpm screenshot | |
- uses: reg-viz/reg-actions@v2 | |
with: | |
github-token: '${{ secrets.GITHUB_TOKEN }}' | |
image-directory-path: 'docx-wasm/export-png/png' | |
threshold-rate: 0.06 | |
enable-antialias: true | |
matching-threshold: 0.5 | |
artifact-name: wasm | |
lint: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: moonrepo/setup-rust@v1 | |
with: | |
inherit-toolchain: true | |
components: clippy | |
# TODO(@unvalley): enable | |
# - run: cargo clippy -- -D warnings |