Test more targets.
This commit is contained in:
parent
b960c697dc
commit
5a366f5707
4 changed files with 47 additions and 22 deletions
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
|
|
@ -12,16 +12,9 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Deploy Release
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
|
||||||
- aarch64-unknown-linux-musl
|
|
||||||
- x86_64-unknown-linux-gnu
|
|
||||||
- x86_64-unknown-linux-musl
|
|
||||||
- x86_64-apple-darwin
|
|
||||||
- x86_64-pc-windows-msvc
|
|
||||||
include:
|
include:
|
||||||
- target: aarch64-unknown-linux-musl
|
- target: aarch64-unknown-linux-musl
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
|
|
@ -33,6 +26,7 @@ jobs:
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
- target: x86_64-pc-windows-msvc
|
- target: x86_64-pc-windows-msvc
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
|
name: Deploy ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
|
|
|
||||||
44
.github/workflows/main.yml
vendored
44
.github/workflows/main.yml
vendored
|
|
@ -5,39 +5,61 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
build: [stable, beta, nightly, macos, windows, msrv]
|
|
||||||
include:
|
include:
|
||||||
- build: stable
|
- name: stable linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: stable
|
rust: stable
|
||||||
- build: beta
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- name: beta linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: beta
|
rust: beta
|
||||||
- build: nightly
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- name: nightly linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: nightly
|
rust: nightly
|
||||||
- build: macos
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- name: stable x86_64-unknown-linux-musl
|
||||||
|
os: ubuntu-20.04
|
||||||
|
rust: stable
|
||||||
|
target: x86_64-unknown-linux-musl
|
||||||
|
- name: stable x86_64 macos
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
rust: stable
|
rust: stable
|
||||||
- build: windows
|
target: x86_64-apple-darwin
|
||||||
|
- name: stable aarch64 macos
|
||||||
|
os: macos-latest
|
||||||
|
rust: stable
|
||||||
|
target: aarch64-apple-darwin
|
||||||
|
- name: stable windows-msvc
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
rust: stable
|
rust: stable
|
||||||
- build: msrv
|
target: x86_64-pc-windows-msvc
|
||||||
|
- name: msrv
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
# sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml
|
# sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml
|
||||||
rust: 1.74.0
|
rust: 1.74.0
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
name: ${{ matrix.name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: bash ci/install-rust.sh ${{ matrix.rust }}
|
run: bash ci/install-rust.sh ${{ matrix.rust }} ${{ matrix.target }}
|
||||||
- name: Build and run tests
|
- name: Build and run tests
|
||||||
run: cargo test --locked
|
run: cargo test --locked --target ${{ matrix.target }}
|
||||||
- name: Test no default
|
- name: Test no default
|
||||||
run: cargo test --no-default-features
|
run: cargo test --no-default-features --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
aarch64-cross-builds:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Install Rust
|
||||||
|
run: bash ci/install-rust.sh stable aarch64-unknown-linux-musl
|
||||||
|
- name: Build
|
||||||
|
run: cargo build --locked --target aarch64-unknown-linux-musl
|
||||||
|
|
||||||
rustfmt:
|
rustfmt:
|
||||||
name: Rustfmt
|
name: Rustfmt
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,19 @@ then
|
||||||
rustup component add llvm-tools-preview --toolchain=$TOOLCHAIN
|
rustup component add llvm-tools-preview --toolchain=$TOOLCHAIN
|
||||||
rustup component add rust-std-$TARGET --toolchain=$TOOLCHAIN
|
rustup component add rust-std-$TARGET --toolchain=$TOOLCHAIN
|
||||||
fi
|
fi
|
||||||
|
if [[ $TARGET == *"musl" ]]
|
||||||
|
then
|
||||||
|
# This is needed by libdbus-sys.
|
||||||
|
sudo apt update -y && sudo apt install musl-dev musl-tools -y
|
||||||
|
fi
|
||||||
|
if [[ $TARGET == "aarch64-unknown-linux-musl" ]]
|
||||||
|
then
|
||||||
|
echo CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld >> $GITHUB_ENV
|
||||||
|
# This `CC` is some nonsense needed for libdbus-sys (via opener).
|
||||||
|
# I don't know if this is really the right thing to do, but it seems to work.
|
||||||
|
sudo apt install gcc-aarch64-linux-gnu -y
|
||||||
|
echo CC=aarch64-linux-gnu-gcc >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rustup default $TOOLCHAIN
|
rustup default $TOOLCHAIN
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,6 @@ TAG=${GITHUB_REF#*/tags/}
|
||||||
|
|
||||||
host=$(rustc -Vv | grep ^host: | sed -e "s/host: //g")
|
host=$(rustc -Vv | grep ^host: | sed -e "s/host: //g")
|
||||||
target=$2
|
target=$2
|
||||||
if [ "$host" != "$target" ]
|
|
||||||
then
|
|
||||||
export "CARGO_TARGET_$(echo $target | tr a-z- A-Z_)_LINKER"=rust-lld
|
|
||||||
fi
|
|
||||||
export CARGO_PROFILE_RELEASE_LTO=true
|
export CARGO_PROFILE_RELEASE_LTO=true
|
||||||
cargo build --locked --bin mdbook --release --target $target
|
cargo build --locked --bin mdbook --release --target $target
|
||||||
cd target/$target/release
|
cd target/$target/release
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue