Skip to content

Commit

Permalink
Add a custom github action to build and test zstd-jni under qemu
Browse files Browse the repository at this point in the history
in order to cover platforms not available in github actions.
  • Loading branch information
jonathan-albrecht-ibm authored and luben committed Nov 25, 2021
1 parent 440fa44 commit e6850e0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/actions/qemu-cross/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'QEMU Cross'
description: 'Compile and test under QEMU'
inputs:
platform:
description: 'qemu guest os'
required: true
runs:
using: 'composite'
steps:
- run: ${{ github.action_path }}/docker.sh
shell: bash
env:
PLATFORM_NAME: ${{ inputs.platform }}
HOST_WORKSPACE_DIR: ${{ github.workspace }}
7 changes: 7 additions & 0 deletions .github/actions/qemu-cross/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

apt-get update
apt-get install -y gcc
./sbt -v test package
9 changes: 9 additions & 0 deletions .github/actions/qemu-cross/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

docker run --rm \
--platform ${PLATFORM_NAME} \
--name qemu-cross-${PLATFORM_NAME} \
--mount type=bind,source=${HOST_WORKSPACE_DIR},target=/github_workspace \
--workdir /github_workspace \
${PLATFORM_NAME}/eclipse-temurin:11-jdk-focal ./.github/actions/qemu-cross/build.sh
18 changes: 18 additions & 0 deletions .github/workflows/ci-qemu-cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "CI qemu cross"
on: [push, pull_request]
jobs:
qemu-cross:
strategy:
matrix:
include: [
{ platform: s390x }
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1

- name: qemu ${{ matrix.platform }} build and test
uses: ./.github/actions/qemu-cross
with:
platform: ${{ matrix.platform }}

0 comments on commit e6850e0

Please sign in to comment.