Skip to content

Commit

Permalink
powerpc64le in CI (#11)
Browse files Browse the repository at this point in the history
* powerpc64le in CI
  • Loading branch information
milesgranger authored Jul 31, 2022
1 parent b319e3f commit 4613daa
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ jobs:
fail-fast: false
matrix:
# matches supported targets from tags in https://hub.docker.com/r/muslcc/x86_64/tags
target: ["aarch64", "x86_64"]
include:
- arch: aarch64
abi: musl
- arch: x86_64
abi: musl
- arch: powerpc64le
abi: gnu

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -26,29 +33,42 @@ jobs:
sudo apt update
sudo apt install -y gcc-multilib
- name: Build ISA-L
- name: Build ISA-L (aarch64, x86_64)
if: ${{ !startsWith(matrix.arch, 'powerpc64le') }}
run: |
docker run --rm -v $(pwd):/code muslcc/x86_64:${{ matrix.target }}-linux-musl sh -c "apk add make nasm && cd /code/isal-sys/isa-l && make install host_cpu=${{ matrix.target }} prefix=./../install -f Makefile.unx CFLAGS_${{ matrix.target }}=-fPIC LDFLAGS=-static"
docker run --rm -v $(pwd):/code muslcc/x86_64:${{ matrix.arch }}-linux-${{ matrix.abi }} sh -c "apk add make nasm && cd /code/isal-sys/isa-l && make install host_cpu=${{ matrix.arch }} prefix=./../install -f Makefile.unx CFLAGS_${{ matrix.arch }}=-fPIC LDFLAGS=-static"
- name: Build ISA-L (powerpc64le)
if: ${{ startsWith(matrix.arch, 'powerpc64le') }}
run: |
sudo apt install -y gcc-10-powerpc64le-linux-gnu
cd isal-sys/isa-l
make install host_cpu=ppc64le prefix=./../install -f Makefile.unx CC=powerpc64le-linux-gnu-gcc-10 CFLAGS_ppc64le=-fPIC LDFLAGS=-static
cd ../..
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}-unknown-linux-musl
target: ${{ matrix.arch }}-unknown-linux-${{ matrix.abi }}
profile: minimal
default: true

- name: Rust Build Caching
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
key: ${{ matrix.arch }}-linux-${{ matrix.abi }}

- name: Build
run: cargo build --target ${{ matrix.target }}-unknown-linux-musl

# Cross to run the tests
run:
cargo build --target ${{ matrix.arch }}-unknown-linux-${{ matrix.abi }}

# Cross for running tests
# Skipping powerpc64le: https://github.com/cross-rs/cross/issues/975
- name: Install cross
if: ${{ !startsWith(matrix.arch, 'powerpc64le') }}
run: cargo install cross

- name: Test
run: cross test --target ${{ matrix.target }}-unknown-linux-musl
if: ${{ !startsWith(matrix.arch, 'powerpc64le') }}
run: cross test --target ${{ matrix.arch }}-unknown-linux-${{ matrix.abi }}
2 changes: 2 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
pre-build = ["apt update && apt install -y llvm-dev libclang-dev clang"] # required by cbindgen
3 changes: 3 additions & 0 deletions isal-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ edition = "2021"
[build-dependencies]
bindgen = "^0.60"
cc = "^1"

[package.metadata.cross.target.powerpc64le-unknown-linux-gnu]
pre-build = ["apt update && apt install -y llvm-dev libclang-dev clang"] # required by cbindgen

0 comments on commit 4613daa

Please sign in to comment.