Skip to content

Commit

Permalink
Merge pull request #30 from silicon-heaven/win-build
Browse files Browse the repository at this point in the history
Win build to create cp2cp during CI
  • Loading branch information
fvacek authored Dec 22, 2024
2 parents 14b3cb7 + ef5e411 commit 9508e48
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/rust.yml
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

0 comments on commit 9508e48

Please sign in to comment.