From 97fcdc888be750f7daa174c1f0c48a88c122dddf Mon Sep 17 00:00:00 2001 From: asonix Date: Wed, 7 Feb 2024 19:22:56 -0600 Subject: [PATCH] Array of targets --- .forgejo/actions/prepare-rust/action.yaml | 18 +++++------------- .forgejo/workflows/check.yaml | 5 ++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.forgejo/actions/prepare-rust/action.yaml b/.forgejo/actions/prepare-rust/action.yaml index b1327160..f64e1121 100644 --- a/.forgejo/actions/prepare-rust/action.yaml +++ b/.forgejo/actions/prepare-rust/action.yaml @@ -3,9 +3,9 @@ description: Prepare an environment to build or test rust packages inputs: targets: - description: "Targets to add to rustup, comma separated" + description: "Array of targets to add to rustup" required: false - default: '' + default: [] runs: using: "composite" @@ -27,26 +27,18 @@ runs: ~/.cargo/git/db ~/.rustup target/ - key: rust-${{ inputs.targets }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock')}} + key: rust-${{ join(inputs.targets, '-') }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock')}} - name: Install rustup and rust if: steps.cache.outputs.cache-hit != 'true' uses: https://github.com/dtolnay/rust-toolchain@1.75.0 with: components: clippy - targets: ${{ inputs.targets }} + targets: ${{ join(inputs.targets, ',') }} - name: Install cargo-zigbuild if: steps.cache.outputs.cache-hit != 'true' - run: | - cargo install cargo-zigbuild - echo "Installed zigbuild" - - - name: Check - if: steps.cache.outputs.cache-hit != 'true' - run: | - echo "GOT HERE" - which cargo + run: cargo install cargo-zigbuild - name: Fetch dependencies if: steps.cache.outputs.cache-hit != 'true' diff --git a/.forgejo/workflows/check.yaml b/.forgejo/workflows/check.yaml index b37cc620..4366b0ff 100644 --- a/.forgejo/workflows/check.yaml +++ b/.forgejo/workflows/check.yaml @@ -55,7 +55,10 @@ jobs: name: Setup Rust uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main with: - targets: x86_64-unknown-linux-musl,armv7-unknown-linux-musleabihf,aarch64-unknown-linux-musl + targets: + - x86_64-unknown-linux-musl + - armv7-unknown-linux-musleabihf + - aarch64-unknown-linux-musl - name: Debug builds run: cargo zigbuild --target ${{ matrix.target }}