Skip to content

Commit a336ec3

Browse files
ViralBShahclaude
andauthored
ci: workflow hygiene (concurrency, timeouts, loongarch fold, mips64, fork-safe codecov) (#346)
* ci: workflow hygiene pass Bundles a few low-risk improvements: - Fold cross-loongarch64.yml into cross.yml; loongarch64 needs the versioned gcc-14 package and per-entry CC/AR overrides, expressed via optional matrix fields with `||` fallbacks. - Add concurrency groups so superseded runs auto-cancel. - Add timeout-minutes: 10 to all jobs so a hung qemu/MSYS2 step fails fast instead of consuming the 6h default. - Bump actions/checkout to v7 (only breaking change is fork PR blocking in pull_request_target/workflow_run, neither used here). - Standardize parallelism: $(nproc) on Linux/MSYS2, $(getconf _NPROCESSORS_ONLN) on macOS (no `nproc` by default). - cross.yml runs `make test` under qemu-user-binfmt with QEMU_LD_PREFIX + LD_LIBRARY_PATH so new tests added to the Makefile target are picked up without editing the workflow. - Uncomment mips64/mips64el (per maintainer request) to surface whatever fails under newer qemu. - Guard the Codecov upload so it's skipped on forked-PR runs where the token isn't exposed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: disable mips64 / mips64el cross jobs (see #347) Failures are spurious FPU exception flags under qemu-user on Ubuntu 24.04 — computed values are correct, only the post-call "Divide by zero" / "Invalid operation" flag state disagrees. 32-bit mips/mipsel pass cleanly under the same setup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: re-enable mips64 / mips64el on ubuntu-26.04 Ubuntu 26.04 ships qemu 10.2.1 (vs 8.2 on 24.04). The MIPS64 n64 FPU flag handling that surfaced as spurious "Divide by zero" / "Invalid operation" failures on 24.04 should be fixed in qemu 10.x. Per-entry runs-on override keeps the rest of the matrix on 24.04. Refs #347. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: re-disable mips64 / mips64el (toolchain dropped from 26.04) Bumping the runner to ubuntu-26.04 to get qemu 10.x doesn't work: Ubuntu 26.04 dropped gcc-mips64-linux-gnuabi64 entirely (Debian's broader MIPS deprecation). 24.04 has the toolchain but the qemu 8.2 FPU flag bug; 26.04 has new qemu but no cross-gcc. Refs #347. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 590f28d commit a336ec3

3 files changed

Lines changed: 56 additions & 88 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ on:
77
branches:
88
- master
99
tags: '*'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
test-unix:
1217
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 10
1319
strategy:
1420
fail-fast: false
1521
matrix:
@@ -19,11 +25,12 @@ jobs:
1925
- macos-latest
2026
- macos-15-intel
2127
steps:
22-
- uses: actions/checkout@v6
23-
- run: make
28+
- uses: actions/checkout@v7
29+
- run: make -j$(getconf _NPROCESSORS_ONLN)
2430
- run: make test
2531
windows:
2632
runs-on: ${{ matrix.os }}
33+
timeout-minutes: 10
2734
strategy:
2835
fail-fast: false
2936
matrix:
@@ -37,38 +44,41 @@ jobs:
3744
run:
3845
shell: msys2 {0}
3946
steps:
40-
- uses: actions/checkout@v6
47+
- uses: actions/checkout@v7
4148
- name: Set up the desired MSYS2 environment
4249
uses: msys2/setup-msys2@v2
4350
with:
4451
msystem: ${{matrix.sys}}
4552
install: base-devel mingw-w64-${{matrix.env}}-toolchain
46-
- run: make
53+
- run: make -j$(nproc)
4754
- run: make test
4855
code-coverage:
4956
runs-on: ubuntu-latest
57+
timeout-minutes: 10
5058
steps:
5159
- name: Checkout Openlibm
52-
uses: actions/checkout@v6
60+
uses: actions/checkout@v7
5361
- name: Checkout Openlibm-test
54-
uses: actions/checkout@v6
62+
uses: actions/checkout@v7
5563
with:
5664
repository: 'JuliaMath/openlibm-test'
5765
path: 'openlibm-test'
5866
- name: Setup LCOV
5967
uses: hrishikesh-kadam/setup-lcov@v1
6068
- name: Build Openlibm
61-
run: make -j`nproc` CODE_COVERAGE=1
69+
run: make -j$(nproc) CODE_COVERAGE=1
6270
- name: Run Test
6371
run: |
64-
make -j`nproc` -C openlibm-test \
72+
make -j$(nproc) -C openlibm-test \
6573
USE_OPENLIBM=1 OPENLIBM_HOME="$(pwd)" \
66-
SKIP_FP_EXCEPT_TEST=1 \
74+
SKIP_FP_EXCEPT_TEST=1
6775
- name: Show Test Result
6876
run: cat openlibm-test/src/REPORT
6977
- name: Gen Coverage Report
7078
run: make gen-cov-report
7179
- name: Upload coverage to Codecov
80+
# Codecov token isn't exposed to forked-PR runs; skip the upload there.
81+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
7282
uses: codecov/codecov-action@v6
7383
with:
7484
files: ./cov-html/libopenlibm.info

.github/workflows/cross-loongarch64.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/cross.yml

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,57 @@ on:
99
- master
1010
tags: '*'
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
build-cross-qemu:
14-
# TODO: We need Ubuntu 24.04 to use newer version of qemu,
15-
# switch to ubuntu-latest when `ubuntu-latest >= 24.04`
1618
runs-on: ubuntu-24.04
19+
timeout-minutes: 10
1720
name: build-cross-qemu-${{ matrix.config.arch }}
1821
strategy:
1922
fail-fast: false
2023
matrix:
2124
config:
22-
- { arch: arm, triple: arm-linux-gnueabihf }
23-
- { arch: aarch64, triple: aarch64-linux-gnu }
24-
- { arch: ppc, triple: powerpc-linux-gnu }
25-
- { arch: ppc64, triple: powerpc64-linux-gnu }
26-
- { arch: ppc64le, triple: powerpc64le-linux-gnu }
27-
- { arch: mips, triple: mips-linux-gnu }
28-
- { arch: mipsel, triple: mipsel-linux-gnu }
29-
# Builds successfully, but tests fail.
30-
# - { arch: mips64, triple: mips64-linux-gnuabi64 }
31-
# - { arch: mips64el, triple: mips64el-linux-gnuabi64 }
32-
- { arch: riscv64, triple: riscv64-linux-gnu }
33-
- { arch: s390x, triple: s390x-linux-gnu }
25+
- { arch: arm, triple: arm-linux-gnueabihf }
26+
- { arch: aarch64, triple: aarch64-linux-gnu }
27+
- { arch: ppc, triple: powerpc-linux-gnu }
28+
- { arch: ppc64, triple: powerpc64-linux-gnu }
29+
- { arch: ppc64le, triple: powerpc64le-linux-gnu }
30+
- { arch: mips, triple: mips-linux-gnu }
31+
- { arch: mipsel, triple: mipsel-linux-gnu }
32+
# mips64 / mips64el disabled. Tests fail under Ubuntu 24.04's
33+
# qemu 8.2 (spurious FPU exception flags); Ubuntu 26.04 has
34+
# newer qemu but dropped the mips64 cross-toolchain entirely.
35+
# See #347.
36+
# - { arch: mips64, triple: mips64-linux-gnuabi64 }
37+
# - { arch: mips64el, triple: mips64el-linux-gnuabi64 }
38+
- { arch: riscv64, triple: riscv64-linux-gnu }
39+
- { arch: s390x, triple: s390x-linux-gnu }
40+
# loongarch64 has no unversioned apt package; pin to gcc-14.
41+
- { arch: loongarch64, triple: loongarch64-linux-gnu,
42+
gcc_pkg: gcc-14-loongarch64-linux-gnu,
43+
cc: loongarch64-linux-gnu-gcc-14,
44+
ar: loongarch64-linux-gnu-gcc-ar-14 }
3445
env:
3546
ARCH: ${{ matrix.config.arch }}
3647
TRIPLE: ${{ matrix.config.triple }}
48+
CC: ${{ matrix.config.cc }}
49+
AR: ${{ matrix.config.ar }}
3750
steps:
38-
- uses: actions/checkout@v6
39-
- name: Install qemu and toolchain gcc-${{ matrix.config.triple }}
51+
- uses: actions/checkout@v7
52+
- name: Install qemu and toolchain
4053
run: |
4154
sudo apt update
42-
sudo apt install qemu-user qemu-user-binfmt gcc-$TRIPLE -y
55+
sudo apt install -y qemu-user qemu-user-binfmt \
56+
${{ matrix.config.gcc_pkg || format('gcc-{0}', matrix.config.triple) }}
4357
- name: Build with ${{ matrix.config.triple }}-gcc
44-
run: make ARCH=$ARCH TOOLPREFIX=$TRIPLE-
58+
run: make -j$(nproc) ARCH=$ARCH TOOLPREFIX=$TRIPLE- ${CC:+CC=$CC} ${AR:+AR=$AR}
4559
- name: Build tests
46-
run: make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE-
47-
- name: Run Tests
60+
run: make -j$(nproc) -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE- ${CC:+CC=$CC} ${AR:+AR=$AR}
61+
- name: Run tests under qemu
4862
env:
49-
QEMU_EXEC: qemu-${{ matrix.config.arch }}
50-
CROSS_LIB: /usr/${{ matrix.config.triple }}
51-
run: |
52-
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-float
53-
$QEMU_EXEC -L . -L $CROSS_LIB/ test/test-double
63+
QEMU_LD_PREFIX: /usr/${{ matrix.config.triple }}
64+
LD_LIBRARY_PATH: .
65+
run: make test

0 commit comments

Comments
 (0)