Remove wasm-bindgen-cli caching #17
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
| # matrix v2 | |
| on: [push,pull_request] | |
| env: | |
| RUSTFLAGS: "-D warnings" | |
| jobs: | |
| ci: | |
| name: Build (${{ matrix.os }} ${{ matrix.channel }} ${{ matrix.target }} ${{ matrix.features }}) | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| matrix: | |
| channel: [""] | |
| features: [""] | |
| target: [""] | |
| os: [ubuntu-latest] | |
| include: | |
| # only linux build contains wasm32 build | |
| - channel: "+nightly" | |
| target: "wasm32-unknown-unknown" | |
| os: "ubuntu-latest" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache target | |
| uses: actions/cache@v4 | |
| with: | |
| key: target-${{ github.event.repository.name }}-${{ matrix.os }}-${{ matrix.channel || 'stable'}}-${{ matrix.target || 'host' }}-${{ matrix.features || 'default' }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| path: | | |
| target | |
| restore-keys: | | |
| target-${{ github.event.repository.name }}-${{ matrix.os }}-${{ matrix.channel || 'stable'}}-${{ matrix.target || 'host' }}-${{ matrix.features || 'default' }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| target-${{ github.event.repository.name }}-${{ matrix.os }}-${{ matrix.channel || 'stable'}}-${{ matrix.target || 'host' }}-${{ matrix.features || 'default' }} | |
| target-${{ github.event.repository.name }}-${{ matrix.os }}-${{ matrix.channel || 'stable'}}-${{ matrix.target || 'host' }} | |
| target-${{ github.event.repository.name }}-${{ matrix.os }}-${{ matrix.channel || 'stable'}} | |
| target-${{ github.event.repository.name }}-${{ matrix.os }} | |
| target-${{ github.event.repository.name }} | |
| # Compute reusable args once | |
| - name: Compute cargo args | |
| id: args | |
| shell: bash | |
| env: | |
| FEATURE_FLAGS: ${{ matrix.features }} | |
| TARGET: ${{ matrix.target }} | |
| run: | | |
| set -euo pipefail | |
| FEATURES_ARG="" | |
| TARGET_ARG="" | |
| if [ -n "${FEATURE_FLAGS}" ]; then | |
| FEATURES_ARG="--features=${FEATURE_FLAGS}" | |
| fi | |
| if [ -n "${TARGET}" ]; then | |
| TARGET_ARG="--target=${TARGET}" | |
| fi | |
| echo "features=${FEATURES_ARG}" >> "$GITHUB_OUTPUT" | |
| echo "target=${TARGET_ARG}" >> "$GITHUB_OUTPUT" | |
| # - name: Github update Rust | |
| # if: runner.os == 'Linux' && !(env.GITEA_ACTIONS == 'true') | |
| # run: | | |
| # # at the moment, GitHub is too far behind mainline rust (v1.89.0-v1.91.0-nightly) | |
| # rustup update | |
| - name: Install wasm target | |
| if: matrix.target == 'wasm32-unknown-unknown' && !(env.GITEA_ACTIONS == 'true') | |
| run: rustup ${{ matrix.channel}} target add wasm32-unknown-unknown | |
| - name: Install wasm-bindgen-cli | |
| if: matrix.target == 'wasm32-unknown-unknown' && !(env.GITEA_ACTIONS == 'true') | |
| run: cargo ${{ matrix.channel }} install wasm-bindgen-cli | |
| - name: Install nightly components | |
| if: matrix.channel == '+nightly' && !(env.GITEA_ACTIONS == 'true') | |
| run: | | |
| rustup ${{ matrix.channel }} component add rustfmt clippy | |
| rustup ${{ matrix.channel }} component add rust-src | |
| - name: rustfmt | |
| run: cargo ${{ matrix.channel }} fmt --check | |
| - name: cargo check | |
| run: cargo ${{ matrix.channel }} check ${{ steps.args.outputs.features }} ${{ steps.args.outputs.target }} | |
| - name: clippy | |
| run: cargo ${{ matrix.channel }} clippy --no-deps ${{ steps.args.outputs.features }} ${{ steps.args.outputs.target }} | |
| - name: docs | |
| run: cargo ${{ matrix.channel }} doc ${{ steps.args.outputs.features }} ${{ steps.args.outputs.target }} | |
| - name: tests | |
| run: cargo ${{ matrix.channel }} test ${{ steps.args.outputs.features }} ${{ steps.args.outputs.target }} |