Skip to content

Commit

Permalink
Add github action for static binary build
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Nov 12, 2024
1 parent e8bd577 commit 756a964
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -45,11 +44,10 @@ jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -66,6 +64,26 @@ jobs:
- name: Build
run: cargo build --release --verbose

build-static:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Set up cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-

- name: Build
run: cargo build --release --target x86_64-unknown-linux-musl --no-default-features -F vendored

integration-test:
needs: build
strategy:
Expand Down Expand Up @@ -101,7 +119,7 @@ jobs:
name: ${{ matrix.plot.path }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Install dependencies (apt)
run: sudo apt-get install libpcsclite-dev
Expand All @@ -115,7 +133,7 @@ jobs:
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Install dependencies (apt)
run: sudo apt-get install libpcsclite-dev
Expand All @@ -127,11 +145,10 @@ jobs:
unit-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -153,6 +170,6 @@ jobs:
fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --all -- --check

0 comments on commit 756a964

Please sign in to comment.