Skip to content

Commit

Permalink
CI: Add 32-bit and 64-bit runners on Alpine Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Jun 19, 2024
1 parent 18063b1 commit 90a3c12
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/dynamic_arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,105 @@ jobs:
esac
alpine:
# if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: ubuntu-latest

defaults:
run:
# Use chroot shell as default
shell: alpine.sh {0}

strategy:
fail-fast: false
matrix:
arch: [x86_64, x86]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Dependencies
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.arch }}
packages: >
build-base
ccache
cmake
gfortran
- name: Print system information
run: lscpu

- name: Prepare ccache
# create key with human readable timestamp
# used in action/cache/restore and action/cache/save steps
id: ccache-prepare
run: |
echo "key=ccache-${{ runner.os }}-alpine-${{ matrix.arch }}-${{ github.ref }}-$(date +"%Y-%m-%d_%H-%M-%S")-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Restore compilation cache
uses: actions/cache@v3
uses: actions/cache/restore@v4
with:
# location of the ccache of the chroot in the root file system
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}
# Restore a matching ccache cache entry. Prefer same branch.
restore-keys: |
ccache-${{ runner.os }}-alpine-${{ matrix.arch }}-${{ github.ref }}
ccache-${{ runner.os }}-alpine-${{ matrix.arch }}
- name: Configure ccache
run: |
test -d ~/.ccache || mkdir ~/.ccache
echo "max_size = 300M" >> ~/.ccache/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf
ccache -s
- name: Build OpenBLAS
run: |
mkdir build && cd build
cmake -DDYNAMIC_ARCH=1 \
-DNOFORTRAN=0 \
-DBUILD_WITHOUT_LAPACK=0 \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
..
cmake --build .
- name: Show ccache status
continue-on-error: true
run: ccache -s

- name: Save compilation cache
# Save the cache after we are done (successfully) building
# This helps to retain the ccache even if the subsequent steps are failing.
uses: actions/cache/save@v4
with:
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
key: ${{ steps.ccache-prepare.outputs.key }}

- name: Run tests
id: run-ctest
timeout-minutes: 60
run: cd build && ctest

- name: Re-run tests
if: always() && (steps.run-ctest.outcome == 'failure')
timeout-minutes: 60
run: |
cd build
echo "::group::Re-run ctest"
ctest --rerun-failed --output-on-failure || true
echo "::endgroup::"
echo "::group::Log from these tests"
[ ! -f Testing/Temporary/LastTest.log ] || cat Testing/Temporary/LastTest.log
echo "::endgroup::"
msys2:
if: "github.repository == 'OpenMathLib/OpenBLAS'"
runs-on: windows-latest
Expand Down

0 comments on commit 90a3c12

Please sign in to comment.