File: test_package.yml

package info (click to toggle)
adios4dolfinx 0.10.0.post0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: python: 4,180; sh: 24; makefile: 7
file content (100 lines) | stat: -rw-r--r-- 2,539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Test package

on:
  workflow_call:
    inputs:
      tag:
        description: "Tag of DOLFINx docker image"
        default: "nightly"
        required: true
        type: string
  workflow_dispatch:
    inputs:
      tag:
        description: "Tag of DOLFINx docker image"
        default: "nightly"
        required: true
        type: string

  pull_request:
    branches:
      - main
  schedule:
    - cron: "0 8 * * *"

env:
  DEB_PYTHON_INSTALL_LAYOUT: deb_system
  DEFAULT_TAG: nightly

jobs:
  get_image_tag:
    runs-on: ubuntu-latest
    outputs:
      image: ${{ steps.docker_tag.outputs.image }}
    steps:
      - id: docker_tag
        run: echo "image=${{ inputs.tag || env.DEFAULT_TAG }}" >> $GITHUB_OUTPUT

  check-formatting:
    needs: get_image_tag
    uses: ./.github/workflows/check_formatting.yml
    with:
      tag: ${{ needs.get_image_tag.outputs.image }}

  create-datasets:
    uses: ./.github/workflows/create_legacy_data.yml
    with:
      artifact_name: "legacy_mpich"

  create-legacy-datasets:
    uses: ./.github/workflows/create_legacy_checkpoint.yml
    with:
      artifact_name: "legacy_checkpoint_mpich"

  test-code:
    runs-on: ubuntu-24.04
    needs:
      [create-datasets, create-legacy-datasets, check-formatting, get_image_tag]
    container: ghcr.io/fenics/dolfinx/dolfinx:${{ needs.get_image_tag.outputs.image }}

    steps:
      - uses: actions/checkout@v5

      - name: Update pip
        run: python3 -m pip install --break-system-packages --upgrade pip setuptools

      - name: Download legacy data
        uses: actions/download-artifact@v5
        with:
          name: legacy_mpich
          path: ./legacy

      - name: Download legacy data
        uses: actions/download-artifact@v5
        with:
          name: legacy_checkpoint_mpich
          path: ./legacy_checkpoint

      - name: Install package
        run: python3 -m pip install --break-system-packages .[test]

      - name: Run tests
        run: |
          coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/

      - name: Run tests in parallel
        run: |
          mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/

      - name: Combine coverage reports
        run: |
          coverage combine
          coverage report -m
          coverage html

      - name: Upload coverage report as artifact
        uses: actions/upload-artifact@v4
        with:
          name: code-coverage-report
          path: htmlcov
          if-no-files-found: error