Skip to content

Merge branch 'trixi-framework:main' into main #22

Merge branch 'trixi-framework:main' into main

Merge branch 'trixi-framework:main' into main #22

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths-ignore:
- 'AUTHORS.md'
- 'CITATION.bib'
- 'CONTRIBUTING.md'
- 'LICENSE.md'
- 'NEWS.md'
- 'README.md'
- '.zenodo.json'
- '.github/workflows/benchmark.yml'
- '.github/workflows/CompatHelper.yml'
- '.github/workflows/TagBot.yml'
- 'benchmark/**'
- 'docs/**'
- 'utils/**'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'CITATION.bib'
- 'CONTRIBUTING.md'
- 'LICENSE.md'
- 'NEWS.md'
- 'README.md'
- '.zenodo.json'
- '.github/workflows/benchmark.yml'
- '.github/workflows/CompatHelper.yml'
- '.github/workflows/TagBot.yml'
- 'benchmark/**'
- 'docs/**'
- 'utils/**'
workflow_dispatch:
# Cancel redundant CI tests automatically
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
# We could also include the Julia version as in
# name: ${{ matrix.trixi_test }} - ${{ matrix.os }} - Julia ${{ matrix.version }} - ${{ matrix.arch }} - ${{ github.event_name }}
# to be more specific. However, that requires us updating the required CI tests whenever we update Julia.
name: ${{ matrix.trixi_test }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.9'
# - '~1.9.0-0' # including development versions
# - 'nightly'
os:
- ubuntu-latest
arch:
- x64
trixi_test:
- tree_part1
- tree_part2
- tree_part3
- tree_part4
- tree_part5
- tree_part6
- structured
- p4est_part1
- p4est_part2
- t8code_part1
- t8code_part2
- unstructured_dgmulti
- parabolic
- paper_self_gravitating_gas_dynamics
- misc_part1
- misc_part2
- performance_specializations_part1
- performance_specializations_part2
- mpi
- threaded
include:
- version: '1.8'
os: ubuntu-latest
arch: x64
trixi_test: threaded_legacy
- version: '1.9'
os: macOS-latest
arch: x64
trixi_test: mpi
- version: '1.9'
os: macOS-latest
arch: x64
trixi_test: threaded
- version: '1.9'
os: windows-latest
arch: x64
trixi_test: mpi
- version: '1.9'
os: windows-latest
arch: x64
trixi_test: threaded
- version: '1.9'
os: macos-14
arch: arm64
trixi_test: threaded
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)'
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
env:
PYTHON: ""
- name: Run tests without coverage
uses: julia-actions/julia-runtest@v1
with:
coverage: false
env:
PYTHON: ""
TRIXI_TEST: ${{ matrix.trixi_test }}
- name: Run tests with coverage
uses: julia-actions/julia-runtest@v1
with:
coverage: true
env:
PYTHON: ""
TRIXI_TEST: ${{ matrix.trixi_test }}
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src,examples,ext
- uses: codecov/codecov-action@v4
with:
file: ./lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
# The standard setup of Coveralls is just annoying for parallel builds, see, e.g.,
# https://github.com/trixi-framework/Trixi.jl/issues/691
# https://github.com/coverallsapp/github-action/issues/47
# https://github.com/coverallsapp/github-action/issues/67
# This standard setup is reproduced below for completeness.
# - uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: run-${{ matrix.trixi_test }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}-${{ github.run_id }}
# parallel: true
# path-to-lcov: ./lcov.info
# Instead, we use a more tedious approach:
# - Store all individual coverage files as artifacts (directly below)
# - Download and merge individual coverage reports in another step
# - Upload only the merged coverage report to Coveralls
- shell: bash
run: |
cp ./lcov.info ./lcov-${{ matrix.trixi_test }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}.info
- uses: actions/upload-artifact@v4
with:
name: lcov-${{ matrix.trixi_test }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}
path: ./lcov-${{ matrix.trixi_test }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}.info
finish:
needs: test
runs-on: ubuntu-latest
steps:
# The standard setup of Coveralls is just annoying for parallel builds, see, e.g.,
# https://github.com/trixi-framework/Trixi.jl/issues/691
# https://github.com/coverallsapp/github-action/issues/47
# https://github.com/coverallsapp/github-action/issues/67
# This standard setup is reproduced below for completeness.
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
# Instead, we use the more tedious approach described above.
# At first, we check out the repository and download all artifacts
# (and list files for debugging).
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: ls -R
# Next, we merge the individual coverage files and upload
# the combined results to Coveralls.
- name: Merge lcov files using Coverage.jl
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.activate(temp=true)
Pkg.add("Coverage")
using Coverage
coverage = LCOV.readfolder(".")
for cov in coverage
cov.filename = replace(cov.filename, "\\" => "/")
end
coverage = merge_coverage_counts(coverage)
@show covered_lines, total_lines = get_summary(coverage)
LCOV.writefile("./lcov.info", coverage)
- uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
# Upload merged coverage data as artifact for debugging
- uses: actions/upload-artifact@v4
with:
name: lcov
path: ./lcov.info
# That's it
- run: echo "Finished testing Trixi"