-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from silicon-heaven/win-build
Win build to create cp2cp during CI
- Loading branch information
Showing
1 changed file
with
34 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
name: Rust | ||
name: Rust Build and Artifact Creation | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
branches: | ||
- master | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: "-Dwarnings" | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
toolchain: | ||
- channel: stable | ||
cargo_args: --verbose --all-targets | ||
clippy_args: "" | ||
- channel: nightly | ||
cargo_args: --verbose --all-targets --all-features | ||
clippy_args: --allow clippy::needless_lifetimes | ||
|
||
runs-on: ubuntu-latest | ||
os: [ubuntu-latest, windows-latest] | ||
toolchain: [stable, nightly] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup toolchain | ||
run: > | ||
rustup update ${{ matrix.toolchain.channel }} && | ||
rustup default ${{ matrix.toolchain.channel }} && | ||
rustup component add clippy | ||
- name: Clippy | ||
run: cargo clippy ${{ matrix.toolchain.cargo_args }} -- ${{matrix.toolchain.clippy_args}} | ||
- name: Build | ||
run: cargo build ${{ matrix.toolchain.cargo_args }} | ||
- name: Run tests | ||
run: cargo test ${{ matrix.toolchain.cargo_args }} -- --test-threads=1 | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
|
||
- name: Build and Install Binary | ||
run: | | ||
mkdir -p ${{github.workspace}}/install | ||
cargo install --path '${{github.workspace}}' --root '${{github.workspace}}/install' --target ${{ matrix.target }} | ||
shell: bash | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.os }}-${{ matrix.toolchain }}-binary | ||
path: ${{github.workspace}}/install/bin |