Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win build to create cp2cp during CI #30

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 37 additions & 28 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
name: Rust
name: Rust Build and Artifact Creation

syyyr marked this conversation as resolved.
Show resolved Hide resolved
on:
push:
branches: [ "master" ]
branches:
- main
- win-build
pull_request:
syyyr marked this conversation as resolved.
Show resolved Hide resolved
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
branches:
- main
- win-build

syyyr marked this conversation as resolved.
Show resolved Hide resolved
syyyr marked this conversation as resolved.
Show resolved Hide resolved
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 install_dir
cargo install --path . --root install_dir --target ${{ matrix.target }}
ls -l install_dir/bin
fvacek marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
fvacek marked this conversation as resolved.
Show resolved Hide resolved

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.toolchain }}-binary
path: install_dir/bin
Loading