Skip to content

Commit

Permalink
Add Linux build and test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
patkenneally committed Dec 15, 2022
1 parent afc39ba commit 6f0bbd1
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "Pull Request Test"

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9"]
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: nschloe/action-checkout-with-lfs-cache@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-packages
with:
# conan cache files are stored in `~/.conan` on Linux/macOS
path: ~/.conan
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cache pip modules
id: cache-pip
uses: actions/cache@v3
env:
cache-name: cache-pip-modules
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: "Install swig and cmake"
run: sudo apt-get update && sudo apt-get install build-essential swig cmake -y
- name: "Install python packages"
run: sudo apt-get install python3-setuptools python3-tk python3.9-venv
- name: "Create virtual Environment"
run: python3 -m venv .venv
- name: "Install wheel and conan package"
run: source .venv/bin/activate && pip3 install wheel conan pytest datashader holoviews
- name: "Build basilisk"
run: source .venv/bin/activate && python3 conanfile.py
- name: "Run Test"
run: |
source .venv/bin/activate
cd src && pytest -m "not scenarioTest" --junitxml=junit/test-results.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

0 comments on commit 6f0bbd1

Please sign in to comment.