Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci/build publish develop docker image #176

Closed
wants to merge 21 commits into from
Prev Previous commit
Next Next commit
drop
patkenneally committed Nov 21, 2023
commit 536fa2d5eecff6035932ce0a81e7be487f6aaadd
292 changes: 146 additions & 146 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,149 +1,149 @@
name: "Pull Request Test"

#
#on:
# pull_request:

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 cmake gtk2.0 libgtk2.0-dev ninja-build swig -y
- name: "Install python packages"
run: sudo apt-get install python3-setuptools python3-tk
- name: "Create virtual Environment"
run: |
python${{ matrix.python-version }} -m venv .venv
source .venv/bin/activate
echo "VIRTUAL ENV:" $VIRTUAL_ENV
- name: "Install wheel and conan package"
run: source .venv/bin/activate && pip3 install wheel conan==1.61.0 pytest datashader holoviews pytest-xdist
- name: "Build basilisk"
run: source .venv/bin/activate && python3 conanfile.py --opNav True
- name: "Run Python Tests"
run: |
source .venv/bin/activate
cd src && pytest -n 2 -m "not scenarioTest" --junitxml=../junit/test-results-${{ matrix.python-version }}.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() }}
- name: "Run C/C++ Tests"
working-directory: ./dist3
run: ctest --gtest_output "json:../ctest/ctest-results-linux-${{ matrix.python-version }}.json"
- name: "Upload Google Test CTest results"
uses: actions/upload-artifact@v3
with:
name: ctest-results-${{ matrix.python-version }}
path: ctest/ctest-results-${{ matrix.python-version }}.json
if: ${{ always() }}

build-windows:
name: Build Windows
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.9"]
permissions:
actions: read
contents: read
security-events: write
env:
MPLBACKEND: agg
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 }}
cache: 'pip'
cache-dependency-path: '**/bskPkgRequired.txt'
- name: Choco help
uses: crazy-max/ghaction-chocolatey@v2
with:
args: -h
- name: "Install swig and cmake"
shell: pwsh
run: choco install swig cmake -y
- name: "Create python virtual env"
shell: pwsh
run: python -m venv venv
- name: "Install wheel and conan package"
shell: pwsh
run: |
venv\Scripts\activate
pip install wheel conan==1.61.0 parse six pytest-xdist
- name: "Add basilisk and cmake path to env path"
shell: pwsh
run: |
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newpath = “$oldpath;${{ env.GITHUB_WORKSPACE }}\dist3\Basilisk;C:\Program Files\CMake\bin”
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
- name: "Build basilisk"
shell: pwsh
run: |
venv\Scripts\activate
python conanfile.py --opNav True
- name: "Test Simulation Python"
shell: pwsh
run: |
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name MPLBACKEND -Value ${MPLBACKEND}
venv\Scripts\activate
cd src\simulation
(Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2 -m "not scenarioTest"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}}
- name: "Python Architecture Tests"
shell: pwsh
run: |
venv\Scripts\activate
cd src\architecture
(Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}}
- name: "Python FswAlgorithms Tests"
shell: pwsh
run: |
venv\Scripts\activate
cd src\fswAlgorithms
(Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}}
- name: "C/C++ Tests"
shell: pwsh
run: |
cd dist3
ctest --gtest_output "json:../ctest/ctest-results-windows-${{ matrix.python-version }}.json"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}
#
#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 cmake gtk2.0 libgtk2.0-dev ninja-build swig -y
# - name: "Install python packages"
# run: sudo apt-get install python3-setuptools python3-tk
# - name: "Create virtual Environment"
# run: |
# python${{ matrix.python-version }} -m venv .venv
# source .venv/bin/activate
# echo "VIRTUAL ENV:" $VIRTUAL_ENV
# - name: "Install wheel and conan package"
# run: source .venv/bin/activate && pip3 install wheel conan==1.61.0 pytest datashader holoviews pytest-xdist
# - name: "Build basilisk"
# run: source .venv/bin/activate && python3 conanfile.py --opNav True
# - name: "Run Python Tests"
# run: |
# source .venv/bin/activate
# cd src && pytest -n 2 -m "not scenarioTest" --junitxml=../junit/test-results-${{ matrix.python-version }}.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() }}
# - name: "Run C/C++ Tests"
# working-directory: ./dist3
# run: ctest --gtest_output "json:../ctest/ctest-results-linux-${{ matrix.python-version }}.json"
# - name: "Upload Google Test CTest results"
# uses: actions/upload-artifact@v3
# with:
# name: ctest-results-${{ matrix.python-version }}
# path: ctest/ctest-results-${{ matrix.python-version }}.json
# if: ${{ always() }}
#
# build-windows:
# name: Build Windows
# runs-on: windows-2019
# strategy:
# matrix:
# python-version: ["3.9"]
# permissions:
# actions: read
# contents: read
# security-events: write
# env:
# MPLBACKEND: agg
# 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 }}
# cache: 'pip'
# cache-dependency-path: '**/bskPkgRequired.txt'
# - name: Choco help
# uses: crazy-max/ghaction-chocolatey@v2
# with:
# args: -h
# - name: "Install swig and cmake"
# shell: pwsh
# run: choco install swig cmake -y
# - name: "Create python virtual env"
# shell: pwsh
# run: python -m venv venv
# - name: "Install wheel and conan package"
# shell: pwsh
# run: |
# venv\Scripts\activate
# pip install wheel conan==1.61.0 parse six pytest-xdist
# - name: "Add basilisk and cmake path to env path"
# shell: pwsh
# run: |
# $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
# $newpath = “$oldpath;${{ env.GITHUB_WORKSPACE }}\dist3\Basilisk;C:\Program Files\CMake\bin”
# Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
# - name: "Build basilisk"
# shell: pwsh
# run: |
# venv\Scripts\activate
# python conanfile.py --opNav True
# - name: "Test Simulation Python"
# shell: pwsh
# run: |
# Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name MPLBACKEND -Value ${MPLBACKEND}
# venv\Scripts\activate
# cd src\simulation
# (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2 -m "not scenarioTest"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}}
# - name: "Python Architecture Tests"
# shell: pwsh
# run: |
# venv\Scripts\activate
# cd src\architecture
# (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}}
# - name: "Python FswAlgorithms Tests"
# shell: pwsh
# run: |
# venv\Scripts\activate
# cd src\fswAlgorithms
# (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}}
# - name: "C/C++ Tests"
# shell: pwsh
# run: |
# cd dist3
# ctest --gtest_output "json:../ctest/ctest-results-windows-${{ matrix.python-version }}.json"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}