Add python-publish.yml (#9) #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build physics-driven-ml | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
# Cancels jobs running if new commits are pushed | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: firedrakeproject/firedrake-vanilla:latest | |
options: --user root | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install torch | |
shell: bash -l {0} | |
run: | | |
source /home/firedrake/firedrake/bin/activate | |
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Install physics-driven-ml | |
shell: bash -l {0} | |
run: | | |
source /home/firedrake/firedrake/bin/activate | |
python -m pip install --upgrade pip | |
python -m pip install -e . | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
source /home/firedrake/firedrake/bin/activate | |
python -m pytest ./tests/ |