Skip to content

Commit

Permalink
Enable full CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjm committed Jun 5, 2024
1 parent 372d04d commit 119277f
Showing 1 changed file with 42 additions and 37 deletions.
79 changes: 42 additions & 37 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,32 @@ permissions:
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUSTFLAGS: -C link-arg=-s

jobs:
# test:
# name: ${{ matrix.cmd.name }} (Rust ${{ matrix.rust }})
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# rust:
# - stable
# cmd:
# - name: Test
# run: cargo test --locked
# - name: Clippy
# run: cargo clippy --locked --tests -- -D warnings
# timeout-minutes: 45
# steps:
# - uses: actions/checkout@v4
# - name: Setup rust
# run: |
# rustup toolchain install ${{ matrix.rust }} --profile minimal --no-self-update
# - name: ${{ matrix.cmd.name }}
# run: ${{ matrix.cmd.run }}
test:
name: ${{ matrix.cmd.name }} (Rust ${{ matrix.rust }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
cmd:
- name: Test
run: cargo test --locked
- name: Clippy
run: cargo clippy --locked --tests -- -D warnings
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup rust
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal --no-self-update
- name: Install build dependencies
run: sudo apt-get install -y libudev-dev
- name: ${{ matrix.cmd.name }}
run: ${{ matrix.cmd.run }}

build:
name: Build for ${{ matrix.target.name }}
Expand All @@ -47,16 +50,16 @@ jobs:
target: x86_64-unknown-linux-gnu
pre-build: |
sudo apt-get install -y libudev-dev
# - name: Windows (x86_64)
# runs-on: windows-latest
# target: x86_64-pc-windows-msvc
# ext: .exe
# - name: MacOS (x86_64)
# runs-on: macos-latest
# target: x86_64-apple-darwin
# - name: MacOS (arm64)
# runs-on: macos-latest
# target: aarch64-apple-darwin
- name: Windows (x86_64)
runs-on: windows-latest
target: x86_64-pc-windows-msvc
ext: .exe
- name: MacOS (x86_64)
runs-on: macos-latest
target: x86_64-apple-darwin
- name: MacOS (arm64)
runs-on: macos-latest
target: aarch64-apple-darwin
timeout-minutes: 45
# env:
# RUSTFLAGS: -C target-feature=+crt-static
Expand All @@ -67,11 +70,9 @@ jobs:
rustup toolchain install stable --target ${{ matrix.target.target }} --profile minimal --no-self-update
- name: Install build dependencies
run: ${{ matrix.target.pre-build }}
if: ${{ matrix.target.pre-build }}
if: matrix.target.pre-build
- name: Build for ${{ matrix.target.name }}
run: cargo build --locked --release --target ${{ matrix.target.target }}
- name: Run for ${{ matrix.target.name }}
run: cargo run --locked --release --target ${{ matrix.target.target }}
- name: Check file
run: |
file target/${{ matrix.target.target }}/release/rust-github-actions-test${{ matrix.target.ext }}
Expand All @@ -84,18 +85,22 @@ jobs:
if-no-files-found: error

release:
name: Update release
name: Create release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
needs: build
needs:
- test
- build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/download-artifact@v4
with:
pattern: rust-github-actions-test.*
merge-multiple: true
- run: find -exec ls -ld {} +
- name: List artifacts
run: find -exec ls -ld {} +
- uses: actions/github-script@v7
id: upload-release-asset
with:
Expand Down

0 comments on commit 119277f

Please sign in to comment.