Skip to content

Commit

Permalink
cross compile attempt 1
Browse files Browse the repository at this point in the history
  • Loading branch information
acheronfail committed Dec 30, 2023
1 parent fae1b0b commit fae10be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
needs: ['prepare-env']
name: build-release
runs-on: ${{ matrix.os }}
Expand All @@ -49,8 +51,9 @@ jobs:
- run: rustup show && rustup target add ${{ matrix.target }}
# install dependencies
- run: just setup
- run: cargo install cross --git https://github.com/cross-rs/cross
# build (generates binaries)
- run: just build --locked --release --target=${{ matrix.target }}
- run: cross build --all --all-features --locked --release --target=${{ matrix.target }}
- run: cargo test --locked manpage
# create archive
- name: Archive
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ env:

jobs:
verify:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
name: Build & Test
runs-on: ubuntu-latest
steps:
Expand All @@ -18,7 +25,7 @@ jobs:
- uses: extractions/setup-just@v1
# setup rust toolchain
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659
- run: rustup show
- run: rustup show && rustup target add ${{ matrix.target }}
# cache
- uses: actions/cache@v3
with:
Expand All @@ -34,11 +41,13 @@ jobs:
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}

# verify
# install dependencies
- run: just setup
- run: just build
- run: cargo install cross --git https://github.com/cross-rs/cross
# verify
- run: cross build --all --all-features --target ${{ matrix.target }}
- run: DEBUG=1 just test

release-aur-git:
Expand Down
3 changes: 0 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ setup:
@check +CMDS:
echo {{CMDS}} | xargs -n1 sh -c 'if ! command -v $1 >/dev/null 2>&1 /dev/null; then echo "$1 is required!"; exit 1; fi' bash

# build the crate
build *args:
cargo build --all --all-features {{args}}
_lbuild:
cargo lbuild --all

Expand Down

0 comments on commit fae10be

Please sign in to comment.