Skip to content

Commit

Permalink
Adapt workflows to skraus-dev#35
Browse files Browse the repository at this point in the history
- Install build dependencies when building the UHID stuff.
- Build UHID stuff on native linux only for now.
  • Loading branch information
felfert committed Apr 30, 2023
1 parent 5852f00 commit e9f04a7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: CD # Continuous Deployment
on:
push:

env:
CARGO_TERM_COLOR: always
INSTALLDEPS: "sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libclang-dev clang llvm"

jobs:

publish:
Expand All @@ -20,34 +24,44 @@ jobs:
binary-postfix: ""
use-cross: false
cargo-command: cargo
buildopts: ""
install-builddeps = false
- os: ubuntu-latest
os-name: linux
target: x86_64-unknown-linux-gnu
architecture: x86_64
binary-postfix: ""
use-cross: false
cargo-command: cargo
buildopts: "--all --features uhid"
install-builddeps = true
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-msvc
architecture: x86_64
binary-postfix: ".exe"
use-cross: false
cargo-command: cargo
buildopts: ""
install-builddeps = false
- os: ubuntu-latest
os-name: linux
target: aarch64-unknown-linux-gnu
architecture: arm64
binary-postfix: ""
use-cross: true
cargo-command: cross
buildopts: ""
install-builddeps = false
- os: ubuntu-latest
os-name: linux
target: i686-unknown-linux-gnu
architecture: i686
binary-postfix: ""
use-cross: true
cargo-command: cross
buildopts: ""
install-builddeps = false

steps:
- name: Checkout repository
Expand All @@ -58,9 +72,12 @@ jobs:
- name: Install cross
if: ${{ matrix.job.use-cross }}
run: cargo install cross
- name: Install build dependencies
if: ${{ matrix.job.install-builddeps }}
run: ${{ env.INSTALLDEPS }}

- name: Cargo build
run: ${{ matrix.job.cargo-command }} build --release --target ${{ matrix.job.target }} --all
run: ${{ matrix.job.cargo-command }} build --release --target ${{ matrix.job.target }} ${{ matrix.job.buildopts }}

- name: install strip command
shell: bash
Expand Down Expand Up @@ -133,4 +150,4 @@ jobs:
with:
toolchain: stable
- name: Publish crate
run: cargo publish -p cherryrgb --token ${{ secrets.CARGO_API_KEY }}
run: cargo publish -p cherryrgb --token ${{ secrets.CARGO_API_KEY }}
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [master]
pull_request:

env:
CARGO_TERM_COLOR: always
INSTALLDEPS: "sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libclang-dev clang llvm"

jobs:

test:
Expand All @@ -13,6 +17,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
run: ${{ env.INSTALLDEPS }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Expand All @@ -37,6 +43,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
run: ${{ env.INSTALLDEPS }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Expand All @@ -50,6 +58,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
run: ${{ env.INSTALLDEPS }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Expand Down

0 comments on commit e9f04a7

Please sign in to comment.