cargo-binstall/.github/workflows/build.yml
dependabot[bot] 24aa099320
Bump cargo_toml from 0.12.4 to 0.13.0 (#486)
Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.12.4 to 0.13.0.
- [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags)
- [Commits](https://gitlab.com/crates.rs/cargo_toml/commits/master)

---
updated-dependencies:
- dependency-name: cargo_toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 02:55:54 +00:00

125 lines
3.4 KiB
YAML

name: Build
on:
workflow_call:
inputs:
for_release:
description: "True if the build is for a release"
required: true
default: false
type: boolean
workflow_dispatch:
inputs:
for_release:
description: "True if the build is for a release"
required: true
default: false
type: boolean
env:
CARGO_TERM_COLOR: always
#CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
debug_features: [ rustls, pkg-config ]
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
debug_features: [ native-tls ]
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: armv7-unknown-linux-musleabihf
os: ubuntu-20.04
use-cross: true
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-20.04
use-cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
use-cross: true
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
use-cross: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- name: Configure toolchain
run: |
rustup toolchain install --profile minimal --no-self-update nightly
rustup default nightly
- name: Install cross
if: matrix.use-cross
uses: taiki-e/install-action@v1
with:
tool: cross
- name: Install host target
if: "!matrix.use-cross"
run: rustup target add ${{ matrix.target }}
- name: Install rust-src
if: inputs.for_release
run: rustup component add rust-src
- name: Select compile settings
shell: bash
run: |
jq \
--argjson for_release '${{ toJSON(inputs.for_release) }}' \
--argjson matrix '${{ toJSON(matrix) }}' \
-nrf .github/scripts/compile-settings.jq \
| tee -a $GITHUB_ENV
- name: Configure caching
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }}
- name: Install musl-tools
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
run: sudo apt-get install -y musl-tools
- name: Install deps
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }}
run: sudo .github/scripts/install-deps.sh
- name: Build
run: ${{ env.CTOOL }} build ${{ env.CARGS }}
env:
RUSTFLAGS: ${{ env.RUSTFLAGS }}
- name: Get output
shell: bash
run: |
cp target/${{ matrix.target }}/${{ env.COUTPUT }}/${{ env.CBIN }} ${{ env.CBIN }}
chmod +x ${{ env.CBIN }} || true
ls -l ${{ env.CBIN }}
- name: Upload output
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: "${{ matrix.target }}.${{ env.CBIN }}"
path: "${{ env.CBIN }}"