Skip to content

fix: handle macOS .framework paths in pkg-config generation #3231

fix: handle macOS .framework paths in pkg-config generation

fix: handle macOS .framework paths in pkg-config generation #3231

Workflow file for this run

name: fpm-deployment
on:
push:
branches: [master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Run tests and deploys the fpm branches
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: '13' }
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install requirements
run: pip install --upgrade -r config/requirements.txt
- uses: fortran-lang/setup-fortran@v1.6.2
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Setup Fortran Package Manager
uses: fortran-lang/setup-fpm@v9
with:
fpm-version: v0.12.0
- run: | # Just for deployment: create stdlib-fpm folder
python config/fypp_deployment.py --deploy_stdlib_fpm
- run: | # Just for deployment: create stdlib-fpm-ilp64 folder
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64
- run: | # Tests without xdp and qp
python config/fypp_deployment.py
fpm test --profile release
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
if: github.event_name != 'pull_request'
with:
BRANCH: stdlib-fpm
FOLDER: stdlib-fpm
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch.
- name: Deploy with 64-bit integer support 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
if: github.event_name != 'pull_request'
with:
BRANCH: stdlib-fpm-ilp64
FOLDER: stdlib-fpm-ilp64
coverage:
name: Generate and upload code coverage report
needs: deploy
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: '13' }
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
- uses: fortran-lang/setup-fortran@v1.6.2
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install requirements
run: pip install --upgrade -r config/requirements.txt
- name: Setup Fortran Package Manager
uses: fortran-lang/setup-fpm@v9
with:
fpm-version: v0.12.0
- name: Prepare for code coverage
if: contains( matrix.os, 'ubuntu')
run: |
sudo apt-get install lcov
- run: | # Use fpm gnu ci to check coverage
python config/fypp_deployment.py
fpm test --profile release --flag '-coverage'
- name: Create coverage report
run: |
set -euo pipefail
mkdir -p ${{ env.COV_DIR }}
mv ./build/gfortran_*/*/* ${{ env.COV_DIR }}
lcov --capture --initial --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.base --ignore-errors mismatch
lcov --capture --base-directory . --directory ${{ env.COV_DIR }} --output-file ${{ env.COV_DIR }}/coverage.capture --ignore-errors mismatch
lcov --add-tracefile ${{ env.COV_DIR }}/coverage.base --add-tracefile ${{ env.COV_DIR }}/coverage.capture --output-file ${{ env.COV_DIR }}/coverage.full.info --ignore-errors mismatch
# Keep only src files in final coverage report to avoid example/ and test/ sources affecting the metric.
lcov --extract ${{ env.COV_DIR }}/coverage.full.info '*/src/*' 'src/**' --output-file ${{ env.COV_DIR }}/coverage.info --ignore-errors unused,mismatch,inconsistent
echo "Files included in final coverage report:"
grep '^SF:' ${{ env.COV_DIR }}/coverage.info | sed 's#^SF:##' | sort -u
env:
COV_DIR: build/coverage
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Upload only the lcov report rooted at src/; otherwise Codecov also
# discovers generated *.gcov files under example/ and treats them as
# primary analyzed sources.
disable_search: true
files: build/coverage/coverage.info