xref: /libCEED/.github/workflows/python-test-with-style.yml (revision dcd9f19c403551effd883234b856bcd9f61ce4a8)
1dfb8ed23Sjeremyltname: Python
23446d1b5SJeremy L Thompson
33446d1b5SJeremy L Thompsonon:
43446d1b5SJeremy L Thompson  push:
5*dcd9f19cSJeremy L Thompson    branches:
6*dcd9f19cSJeremy L Thompson      - main
7*dcd9f19cSJeremy L Thompson  pull_request:
83446d1b5SJeremy L Thompson
93446d1b5SJeremy L Thompsonjobs:
103446d1b5SJeremy L Thompson  test:
113446d1b5SJeremy L Thompson    strategy:
123446d1b5SJeremy L Thompson      matrix:
136c0547c1SJeremy L Thompson        os: [ubuntu-22.04]
146c0547c1SJeremy L Thompson        compiler: [gcc-11]
1542e6192fSJeremy L Thompson        python-version: ['3.x']
163446d1b5SJeremy L Thompson
173446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
183446d1b5SJeremy L Thompson
193446d1b5SJeremy L Thompson    steps:
203446d1b5SJeremy L Thompson    - name: Environment setup
210adbbf50SJeremy L Thompson      uses: actions/checkout@v3
223446d1b5SJeremy L Thompson    - name: Python setup
2342e6192fSJeremy L Thompson      uses: actions/setup-python@v4
2442e6192fSJeremy L Thompson      with:
2542e6192fSJeremy L Thompson        python-version: ${{ matrix.python-version }}
263446d1b5SJeremy L Thompson    - name: Python dependencies
273446d1b5SJeremy L Thompson      run: |
283446d1b5SJeremy L Thompson        pip install -r requirements.txt
293446d1b5SJeremy L Thompson        pip install -r requirements-test.txt
303446d1b5SJeremy L Thompson    - name: Python test
313446d1b5SJeremy L Thompson      env:
323446d1b5SJeremy L Thompson        CC: ${{ matrix.compiler }}
336c0547c1SJeremy L Thompson        FC: gfortran-11
343446d1b5SJeremy L Thompson      run: |
353446d1b5SJeremy L Thompson        make info
363446d1b5SJeremy L Thompson        make -j2
373446d1b5SJeremy L Thompson        export CEED_DIR=$PWD
383446d1b5SJeremy L Thompson        pip install .
390ef72598Sjeremylt        cd python/tests
40619db83cSjeremylt        PYTHON=python3 make test TEST_OPTS="--ceed /cpu/self/ref/serial -vv"
413446d1b5SJeremy L Thompson        cd ../..
423446d1b5SJeremy L Thompson    - name: Python style
433446d1b5SJeremy L Thompson      env:
443446d1b5SJeremy L Thompson        CC: ${{ matrix.compiler }}
456c0547c1SJeremy L Thompson        FC: gfortran-11
463446d1b5SJeremy L Thompson      run: |
472b730f8bSJeremy L Thompson        make format-py && git diff --exit-code
48