-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afc39ba
commit 6f0bbd1
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
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() }} |