xref: /libCEED/.github/workflows/python-test-with-style.yml (revision 3446d1b5ce8d1a4e72ebab9baee4f1efd0361227)
1*3446d1b5SJeremy L Thompsonname: Python - Test and Style
2*3446d1b5SJeremy L Thompson
3*3446d1b5SJeremy L Thompsonon:
4*3446d1b5SJeremy L Thompson  push:
5*3446d1b5SJeremy L Thompson
6*3446d1b5SJeremy L Thompsonjobs:
7*3446d1b5SJeremy L Thompson  test:
8*3446d1b5SJeremy L Thompson    strategy:
9*3446d1b5SJeremy L Thompson      matrix:
10*3446d1b5SJeremy L Thompson        os: [ubuntu-latest]
11*3446d1b5SJeremy L Thompson        compiler: [gcc-9]
12*3446d1b5SJeremy L Thompson
13*3446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
14*3446d1b5SJeremy L Thompson
15*3446d1b5SJeremy L Thompson    steps:
16*3446d1b5SJeremy L Thompson    - name: Environment setup
17*3446d1b5SJeremy L Thompson      uses: actions/checkout@v2
18*3446d1b5SJeremy L Thompson    - name: Python setup
19*3446d1b5SJeremy L Thompson      uses: actions/setup-python@v2
20*3446d1b5SJeremy L Thompson    - name: Python dependencies
21*3446d1b5SJeremy L Thompson      run: |
22*3446d1b5SJeremy L Thompson        pip install -r requirements.txt
23*3446d1b5SJeremy L Thompson        pip install -r requirements-test.txt
24*3446d1b5SJeremy L Thompson    - name: Python test
25*3446d1b5SJeremy L Thompson      env:
26*3446d1b5SJeremy L Thompson        CC: ${{ matrix.compiler }}
27*3446d1b5SJeremy L Thompson        FC: gfortran-9
28*3446d1b5SJeremy L Thompson      run: |
29*3446d1b5SJeremy L Thompson        make info
30*3446d1b5SJeremy L Thompson        make -j2
31*3446d1b5SJeremy L Thompson        export CEED_DIR=$PWD
32*3446d1b5SJeremy L Thompson        pip install .
33*3446d1b5SJeremy L Thompson        cd tests/python
34*3446d1b5SJeremy L Thompson        python setup-qfunctions.py build
35*3446d1b5SJeremy L Thompson        pytest test-*.py --ceed /cpu/self/ref/serial -vv
36*3446d1b5SJeremy L Thompson        cd ../..
37*3446d1b5SJeremy L Thompson    - name: Python style
38*3446d1b5SJeremy L Thompson      env:
39*3446d1b5SJeremy L Thompson        CC: ${{ matrix.compiler }}
40*3446d1b5SJeremy L Thompson        FC: gfortran-9
41*3446d1b5SJeremy L Thompson      run: |
42*3446d1b5SJeremy L Thompson        make style-py && git diff --exit-code
43