Skip to content

Add autodiscovery for type generation #486

Add autodiscovery for type generation

Add autodiscovery for type generation #486

Workflow file for this run

name: build
on:
push:
pull_request:
branches:
- master
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"
RUST_BACKTRACE: short
NEXTEST_PROFILE: ci
CI: 1
jobs:
build-crux:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- uses: dtolnay/[email protected]
with:
components: rustfmt
- uses: pnpm/action-setup@v2
with:
version: 7.32.2
- name: Check formatting
shell: bash
run: cargo fmt --all --check
- name: Build crux
shell: bash
run: cargo build --workspace
- name: Install nextest
shell: bash
run: |
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Build tests
shell: bash
run: |
cargo nextest run --workspace --all-features --no-run
- name: Run tests
shell: bash
run: |
cargo nextest run --workspace --all-features
- name: Build & run doctests
shell: bash
run: |
cargo test --doc --workspace
find-examples:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
outputs:
examples: ${{ steps.find.outputs.examples }}
steps:
- uses: actions/checkout@v2
- id: find
run: |
EXAMPLES=$(ls -d examples/*/ | xargs -L 1 basename | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')
echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT
build-examples:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
needs: find-examples
strategy:
matrix:
example: ${{ fromJson(needs.find-examples.outputs.examples) }}
defaults:
run:
working-directory: examples/${{ matrix.example }}
steps:
- uses: actions/checkout@v2
# The counter example uses tauri, which has additional dependencies that are not needed for other examples
- name: Install tauri dependencies
shell: bash
if: ${{ matrix.example == 'counter' }}
run: >
sudo apt-get update &&
sudo apt-get install -y
build-essential
curl
wget
libssl-dev
libgtk-3-dev
libayatana-appindicator3-dev
librsvg2-dev
libwebkit2gtk-4.1-dev
- uses: Swatinem/rust-cache@v1
- uses: dtolnay/[email protected]
with:
components: rustfmt
- uses: pnpm/action-setup@v2
with:
version: 7.32.2
- name: Check formatting
shell: bash
run: cargo fmt --all --check
- name: Build ${{ matrix.example }}
shell: bash
run: cargo build --workspace
- name: Install nextest
shell: bash
run: |
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Build tests
shell: bash
run: |
cargo nextest run --workspace --all-features --no-run
- name: Run tests
shell: bash
run: |
cargo nextest run --workspace --all-features
- name: Build & run doctests
shell: bash
run: |
cargo test --doc --workspace