chore: is leading slash a problem? #87
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: Rust | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22.1] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
cache-dependency-path: webzebra/yarn.lock | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2025-02-01 | |
override: true | |
profile: minimal | |
components: llvm-tools-preview | |
- name: Cache cargo files | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/.crates.toml | |
~/.cargo/.crates2.json | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
./target | |
./test-target | |
key: ${{ runner.os }}-cargo-files-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', '~/.cargo/.crates.toml', '~/.cargo/.crates2.json', '**/run-tests.sh') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-files- | |
- name: Install Binutils | |
run: cargo install cargo-binutils || cargo install cargo-binutils --force | |
- name: Install Wasm Pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Build and run tests | |
env: | |
CARGO_INCREMENTAL: 0 | |
run: bash ./run-tests.sh | |
- name: Build Rust WebZebra crate | |
working-directory: ./webzebra/crate | |
env: | |
CARGO_INCREMENTAL: 0 | |
run: wasm-pack build --target web --release | |
- name: Install yarn Deps | |
working-directory: ./webzebra | |
run: yarn --frozen-lockfile | |
- name: Build WebZebra | |
working-directory: ./webzebra | |
run: yarn vite build | |
- name: Package dist directory | |
working-directory: ./webzebra/dist | |
run: zip -r ../dist.zip . | |
- name: Deploy Webzebra | |
if: github.ref == 'refs/heads/master' | |
working-directory: ./webzebra | |
env: | |
NETLIFY_ACCESS_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }} | |
run: | | |
curl -H "Content-Type: application/zip" \ | |
-H "Authorization: Bearer ${NETLIFY_ACCESS_TOKEN}" \ | |
--data-binary "@dist.zip" \ | |
https://api.netlify.com/api/v1/sites/webzebra.netlify.app/deploys \ | |
--fail \ | |
-o /dev/null \ | |
--show-error |