Skip to content

chore: release v0.1.1 #21

chore: release v0.1.1

chore: release v0.1.1 #21

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths:
- .github/workflows/ci.yml
- Cargo.**
- crates/**
- examples/**
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: "always"
RUST_LOG: "info"
RUST_BACKTRACE: "1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
test:
name: Test
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'release-plz-')
permissions:
contents: read
actions: write # evict cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Get cache key
run: |
CARGO_VERSION=$(cargo --version)
echo "CACHE_KEY=${{ runner.os }}-${{ runner.arch }}-$CARGO_VERSION-${{hashFiles('**/Cargo.toml')}}-${{hashFiles('**/Cargo.lock')}}-${{github.workflow}}-${{github.job}}" >> "$GITHUB_OUTPUT"
{
echo "CACHE_KEY_RESTORE<<EOF"
echo "${{ runner.os }}-${{ runner.arch }}-$CARGO_VERSION-${{hashFiles('**/Cargo.toml')}}-${{hashFiles('**/Cargo.lock')}}-"
echo "${{ runner.os }}-${{ runner.arch }}-$CARGO_VERSION-${{hashFiles('**/Cargo.toml')}}-"
echo "${{ runner.os }}-${{ runner.arch }}-$CARGO_VERSION-"
echo "EOF"
} >> "$GITHUB_OUTPUT"
id: cache-key
shell: bash
- uses: actions/cache/restore@v4
with:
path: |
target/
key: ${{ steps.cache-key.outputs.CACHE_KEY }}
restore-keys: ${{ steps.cache-key.outputs.CACHE_KEY_RESTORE }}
id: cache-restore
- run: cargo test --all-features --no-fail-fast -- --include-ignored
- run: cargo build --workspace
- name: Evict cache
run: gh cache delete '${{ steps.cache-key.outputs.CACHE_KEY }}'
if: ${{ steps.cache-restore.outputs.cache-hit }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache/save@v4
if: always()
with:
path: |
target/
key: ${{ steps.cache-key.outputs.CACHE_KEY }}
- name: Save cache key
id: save-cache-key
run: |
echo "CACHE_KEY=${{ steps.cache-key.outputs.CACHE_KEY }}" >> "$GITHUB_OUTPUT"
{
echo "CACHE_KEY_RESTORE<<EOF"
echo "${{ steps.cache-key.outputs.CACHE_KEY }}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
shell: bash
outputs:
CACHE_KEY: ${{ steps.save-cache-key.outputs.CACHE_KEY }}
CACHE_KEY_RESTORE: ${{ steps.save-cache-key.outputs.CACHE_KEY_RESTORE }}
test-examples:
name: Test examples
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- uses: actions/cache/restore@v4
with:
path: |
target/
key: ${{ needs.test.outputs.CACHE_KEY }}
restore-keys: ${{ needs.test.outputs.CACHE_KEY_RESTORE }}
- run: cargo run --package example-console
if: always()
- run: cargo run --package example-calculator
if: always()
- run: cargo run --package example-fibonacci
if: always()
- run: cargo run --package example-ts
if: always()
- run: cargo run --package example-ts-blank-space
if: always()