Skip to content

fix(ticks): unify symlog tick label superscripts with log (10^{n}) #2156

fix(ticks): unify symlog tick label superscripts with log (10^{n})

fix(ticks): unify symlog tick label superscripts with log (10^{n}) #2156

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
# Cancel previous runs on new commits to the same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Tests (${{ matrix.os }})
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Root artifact hygiene check (Issue #990)
if: matrix.os == 'ubuntu-latest'
run: bash scripts/check_root_artifacts.sh
# ---------- Ubuntu setup ----------
- name: Cache and install apt packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@v1.5.3
with:
packages: gfortran cmake make ffmpeg pngcheck python3-pil imagemagick poppler-utils ghostscript
version: 1
- name: Setup Fortran Package Manager (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
for i in 1 2 3; do
echo "FPM download attempt $i"
if wget --timeout=30 --tries=2 https://github.com/fortran-lang/fpm/releases/download/v0.12.0/fpm-0.12.0-linux-x86_64-gcc-12; then
chmod +x fpm-0.12.0-linux-x86_64-gcc-12
sudo mv fpm-0.12.0-linux-x86_64-gcc-12 /usr/local/bin/fpm
fpm --version
break
else
echo "FPM download failed, attempt $i"
sleep 10
if [ $i -eq 3 ]; then
echo "All FPM download attempts failed, installing from package manager"
sudo apt-get update
sudo apt-get install -y curl
curl -fsSL https://fpm.fortran-lang.org/install.sh | bash
sudo ln -sf ~/.local/bin/fpm /usr/local/bin/fpm || echo "FPM fallback failed"
fi
fi
done
# Python setup for bridge tests (Ubuntu)
- name: Setup Python (Ubuntu)
if: matrix.os == 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
python3 -m pip install --upgrade pip
python3 -m pip install numpy
# ---------- Windows setup ----------
- name: Configure git line endings (Windows)
if: runner.os == 'Windows'
shell: bash
run: git config --global core.autocrlf input
- name: Define MSYS2_DIR (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
# Place a reusable MSYS2 install next to the workspace (works on C: or D:)
$msys2Dir = Join-Path (Split-Path $env:GITHUB_WORKSPACE -Parent) '_msys2'
echo "MSYS2_DIR=$msys2Dir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache full MSYS2 installation (Windows)
if: runner.os == 'Windows'
id: msys2_cache
uses: actions/cache@v4
with:
path: ${{ env.MSYS2_DIR }}
key: ${{ runner.os }}-msys2-full-MINGW64-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
${{ runner.os }}-msys2-full-MINGW64-
- name: Detect existing MSYS2 installation
if: runner.os == 'Windows'
id: msys2_detect
shell: pwsh
run: |
$root = "$env:MSYS2_DIR"
$msysPath = Join-Path $root 'msys64'
if (Test-Path $msysPath) {
"present=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Host "Detected existing MSYS2 at $msysPath"
} else {
"present=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
Write-Host "No existing MSYS2 at $msysPath"
}
- name: Setup MSYS2 (Windows)
if: runner.os == 'Windows' && steps.msys2_detect.outputs.present != 'true'
id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true # Only runs when MSYS2 not present; safe to update
path-type: inherit
cache: true # Use builtin package cache for reliability
release: true # Install from release tarball into location
location: ${{ env.MSYS2_DIR }}
install: >-
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ffmpeg
mingw-w64-x86_64-imagemagick
git
- name: Add MinGW to PATH (Windows)
if: runner.os == 'Windows'
run: |
$msysLoc = "${{ steps.msys2.outputs.msys2-location }}"
if (-not $msysLoc) { $msysLoc = "$env:MSYS2_DIR" }
echo (Join-Path $msysLoc 'mingw64\bin') | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: pwsh
- name: Install FPM (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$msysLoc = "${{ steps.msys2.outputs.msys2-location }}"
if (-not $msysLoc) { $msysLoc = "$env:MSYS2_DIR" }
$destDir = Join-Path $msysLoc 'mingw64\bin'
if (-not (Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir -Force | Out-Null }
$dest = Join-Path $destDir 'fpm.exe'
if (Test-Path $dest) {
& $dest --version
} else {
Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/fortran-lang/fpm/releases/download/v0.12.0/fpm-0.12.0-windows-x86_64-gcc-12.exe" -OutFile $dest
& $dest --version
}
# ---------- Build & Test ----------
- name: Create test directories
shell: bash
run: |
mkdir -p build/test
mkdir -p output/example/fortran/basic_plots
mkdir -p output/example/fortran/legend_demo
mkdir -p output/example/fortran/marker_demo
- name: Verify file size compliance (limits)
if: matrix.os == 'ubuntu-latest'
run: make verify-size-compliance
- name: Build project
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
fpm build --flag "-cpp -fmax-stack-var-size=65536 -Wno-implicit-interface"
else
make build
fi
- name: Build required examples for tests (Linux only)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
make example ARGS="basic_plots"
make example ARGS="legend_demo"
make example ARGS="contour_demo"
make example ARGS="marker_demo"
make example ARGS="format_string_demo"
- name: Verify artifacts (Linux only)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
make verify-artifacts
- name: Run tests
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
export FORTPLOT_ENABLE_FFMPEG=1
export OMP_NUM_THREADS=2
fpm test --flag "-cpp -fmax-stack-var-size=65536 -Wno-implicit-interface"
else
export FORTPLOT_ENABLE_FFMPEG=0
export OMP_NUM_THREADS=2
mkdir -p /tmp/test
timeout 10m make test-ci
fi
- name: Run antialiasing quality tests with ImageMagick (optional)
shell: bash
run: |
if magick -version > /dev/null 2>&1; then
if [ "$RUNNER_OS" = "Windows" ]; then
fpm test test_antialiasing_restoration --flag "-cpp -fmax-stack-var-size=65536 -Wno-implicit-interface" || echo "Antialiasing tests optional on Windows"
fpm test test_antialiasing_comprehensive --flag "-cpp -fmax-stack-var-size=65536 -Wno-implicit-interface" || echo "Antialiasing tests optional on Windows"
else
fpm test test_antialiasing_restoration
fpm test test_antialiasing_comprehensive
fi
else
echo "ImageMagick not found - skipping graphics quality tests"
fi
- name: Test FPM and CMake examples (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
timeout 2m fpm test --target test_system_fpm_example || echo "FPM example test skipped due to timeout"
timeout 2m fpm test --target test_system_cmake_example || echo "CMake example test skipped due to timeout"
# Coverage job removed intentionally; no coverage analysis for now