|
| 1 | +name: PR - pure Python tests in Container |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - devel |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - devel |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +defaults: |
| 17 | + run: |
| 18 | + shell: bash |
| 19 | + |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + |
| 23 | +jobs: |
| 24 | + model-tests-in-container-with-reqs: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + |
| 27 | + container: |
| 28 | + image: ghcr.io/struphy-hub/struphy/ubuntu-with-reqs:latest |
| 29 | + credentials: |
| 30 | + username: spossann |
| 31 | + password: ${{ secrets.GHCR_TOKEN }} |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Check for dockerenv file |
| 35 | + run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) |
| 36 | + |
| 37 | + - name: Checkout repo |
| 38 | + uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Check .testmondata 1 |
| 41 | + run: | |
| 42 | + ls .testmon* || echo "No .testmondata" |
| 43 | +
|
| 44 | + - name: Setup cache for testmon |
| 45 | + uses: actions/cache@v4 |
| 46 | + with: |
| 47 | + path: | |
| 48 | + .testmondata-pure-python |
| 49 | + .testmondata-pure-python-mpi |
| 50 | + key: testmon-pure-python-${{ github.ref_name }}-${{ github.event.number }}-${{ github.run_number }} |
| 51 | + restore-keys: | |
| 52 | + testmon-pure-python-${{ github.ref_name }}-${{ github.event.number }}- |
| 53 | + testmon-pure-python-${{ github.ref_name }} |
| 54 | + testmon-pure-python-devel |
| 55 | + testmon-pure-python- |
| 56 | +
|
| 57 | + - name: Check .testmondata 2 |
| 58 | + run: | |
| 59 | + ls .testmon* || echo "No .testmondata" |
| 60 | +
|
| 61 | + # This step can be removed when the updated ghcr images are pushed |
| 62 | + - name: Install sqlite |
| 63 | + shell: bash |
| 64 | + run: apt install -y sqlite3 |
| 65 | + |
| 66 | + - name: Install Struphy |
| 67 | + uses: ./.github/actions/install/install-struphy |
| 68 | + |
| 69 | + - name: LinearMHD test |
| 70 | + shell: bash |
| 71 | + env: |
| 72 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python |
| 73 | + run: | |
| 74 | + source env/bin/activate |
| 75 | + struphy compile --status |
| 76 | + struphy test LinearMHD |
| 77 | +
|
| 78 | + - name: Vlasov test |
| 79 | + shell: bash |
| 80 | + env: |
| 81 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python |
| 82 | + run: | |
| 83 | + source env/bin/activate |
| 84 | + struphy test Vlasov |
| 85 | +
|
| 86 | + - name: GuidingCenter test |
| 87 | + shell: bash |
| 88 | + env: |
| 89 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python |
| 90 | + run: | |
| 91 | + source env/bin/activate |
| 92 | + struphy test GuidingCenter |
| 93 | +
|
| 94 | + - name: VlasovAmpere test |
| 95 | + shell: bash |
| 96 | + env: |
| 97 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python |
| 98 | + run: | |
| 99 | + source env/bin/activate |
| 100 | + struphy test VlasovAmpereOneSpecies |
| 101 | +
|
| 102 | + - name: EulerSPH test |
| 103 | + shell: bash |
| 104 | + env: |
| 105 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python |
| 106 | + run: | |
| 107 | + source env/bin/activate |
| 108 | + struphy test EulerSPH |
| 109 | +
|
| 110 | + - name: Vlasov test MPI |
| 111 | + shell: bash |
| 112 | + env: |
| 113 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi |
| 114 | + run: | |
| 115 | + source env/bin/activate |
| 116 | + struphy test Vlasov --mpi 2 |
| 117 | +
|
| 118 | + - name: GuidingCenter test MPI |
| 119 | + shell: bash |
| 120 | + env: |
| 121 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi |
| 122 | + run: | |
| 123 | + source env/bin/activate |
| 124 | + struphy test GuidingCenter --mpi 2 |
| 125 | +
|
| 126 | + - name: VlasovAmpere test MPI |
| 127 | + shell: bash |
| 128 | + env: |
| 129 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi |
| 130 | + run: | |
| 131 | + source env/bin/activate |
| 132 | + struphy test VlasovAmpereOneSpecies --mpi 2 |
| 133 | +
|
| 134 | + - name: EulerSPH test MPI |
| 135 | + shell: bash |
| 136 | + env: |
| 137 | + TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python-mpi |
| 138 | + run: | |
| 139 | + source env/bin/activate |
| 140 | + struphy test EulerSPH --mpi 2 |
0 commit comments