Skip to content

chore(worker): update CI #219

chore(worker): update CI

chore(worker): update CI #219

Workflow file for this run

name: CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build-main:
strategy:
matrix:
featureset:
- flag: ""
- flag: "--all-features"
- flag: "--no-default-features"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
cargo --version
cargo build --verbose ${{ matrix.featureset.flag }}
- name: Test
run: cargo test ${{ matrix.featureset.flag }} --verbose
- name: Check Format
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets ${{ matrix.featureset.flag }} -- -D warnings
build-cli:
needs: build-main
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli/
steps:
- uses: actions/checkout@v2
- name: Build
run: |
cargo --version
cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check Format
run: cargo fmt -- --check
build-pyo3:
needs: build-main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Symlink README
run: |
cd pyo3/
ln -s ../README.md ./
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --sdist -o pyo3/dist --find-interpreter -m pyo3/Cargo.toml
build-typst:
needs: build-main
runs-on: ubuntu-latest
defaults:
run:
working-directory: typst/
steps:
- uses: actions/checkout@v3
- name: Install Wasm target for Rust
run: rustup target add wasm32-unknown-unknown
- name: Install Typst
run: curl -fsSL https://typst.community/typst-install/install.sh | sh
- name: Build
run: |
cargo --version
cargo build --release --verbose --target wasm32-unknown-unknown
- name: Typst Compile
run: |
cp target/wasm32-unknown-unknown/release/zhconv_typst.wasm ./
/home/runner/.typst/bin/typst compile example.typ
- name: Clippy
run: cargo clippy --target wasm32-unknown-unknown --all-features -- -D warnings
- name: Check Format
run: cargo fmt -- --check
# now Pages.dev do this for us
# build-web:
# needs: build-main
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: "16"
# - name: Init web
# working-directory: web/
# run: |
# node --version
# yarn --version
# yarn install
# - name: Build
# working-directory: web/
# run: yarn build
# - name: Test
# working-directory: web/
# run: yarn test # no effective test so far
# adapted from: https://github.com/Gowee/cidr-aggregator/blob/9c02241ab64e5cf62e33375e55e09502385bdc61/.github/workflows/main.yml#L1
# which is in turn adapted from:
# https://github.com/Gowee/json2pyi/blob/4e13b4767f97d79e90ecf19a0cb21b1e799d7d48/.github/workflows/main.yml