Log rustc version, just to be sure #190
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
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| name: Build | ||
| jobs: | ||
| # Define Rust versions dynamically | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.rust_versions }} | ||
| steps: | ||
| - id: set-matrix | ||
| run: | | ||
| echo 'rust_versions={"rust": ["stable", "1.85"]}' >> "$GITHUB_OUTPUT" | ||
| # Build the library | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install ${{ matrix.rust }} | ||
| rustup default ${{ matrix.rust }} | ||
| - name: Build | ||
| run: | | ||
| cargo build --examples | ||
| # Cross-Build the library with no_std | ||
| cross-build: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| strategy: | ||
| matrix: | ||
| rust: ${{ fromJSON(needs.setup.outputs.matrix).rust }} | ||
| target: | ||
| - thumbv7em-none-eabihf | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install ${{ matrix.rust }} | ||
| rustup default ${{ matrix.rust }} | ||
| rustup target add ${{ matrix.target }} | ||
| - name: Build | ||
| run: | | ||
| cargo build --manifest-path ./examples/no_std/Cargo.toml --target ${{ matrix.target }} | ||
| # Build the macro | ||
| build-macro: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install ${{ matrix.rust }} | ||
| rustup default ${{ matrix.rust }} | ||
| - name: Build | ||
| run: | | ||
| cd macro | ||
| cargo build | ||
| # Gather all the above build jobs together for the purposes of getting an overall pass-fail | ||
| build-all: | ||
| runs-on: ubuntu-latest | ||
| needs: [build, build-macro, cross-build] | ||
| steps: | ||
| - run: /bin/true | ||
| # Test the library - but only on one fixed version because we have | ||
| # expected errors, and they change between releases | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install 1.95 | ||
| rustup default 1.95 | ||
| - run: | | ||
| rustc --version | ||
| cargo test | ||
| # Build the docs for the library | ||
| docs: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install ${{ matrix.rust }} | ||
| rustup default ${{ matrix.rust }} | ||
| - name: Build docs | ||
| run: | | ||
| cargo doc --examples | ||
| # Format the library | ||
| fmt: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install 1.95 | ||
| rustup default 1.95 | ||
| rustup component add rustfmt | ||
| - name: Format Check | ||
| run: | | ||
| cargo fmt --check | ||
| - name: Format Check for macro | ||
| run: | | ||
| cd macro | ||
| cargo fmt --check | ||
| # Run clippy on the library | ||
| clippy: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| strategy: | ||
| matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Install rust | ||
| run: | | ||
| rustup install ${{ matrix.rust }} | ||
| rustup default ${{ matrix.rust }} | ||
| rustup component add clippy | ||
| - name: Clippy | ||
| run: | | ||
| cargo clippy --examples | ||
| - name: Clippy for the Macro | ||
| run: | | ||
| cd macro | ||
| cargo clippy | ||
| # Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail | ||
| all: | ||
| runs-on: ubuntu-latest | ||
| needs: [docs, build-all, test, fmt] # not gating on clippy-all | ||
| steps: | ||
| - run: /bin/true | ||