Use artifact instead of cache for linux build #4
Workflow file for this run
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: linux-run-tests-build-docs | ||
on: | ||
workflow_call: | ||
secrets: | ||
DEPENDENCY_ACCESS_TOKEN: | ||
required: true | ||
inputs: | ||
ERT_SHOW_BACKTRACE: | ||
required: true | ||
type: string | ||
NO_PROJECT_RES: | ||
required: true | ||
type: string | ||
BOOST_VERSION: | ||
required: true | ||
type: string | ||
BOOST_VERSION_UNDERSCORES: | ||
required: true | ||
type: string | ||
DAKOTA_VERSION: | ||
required: true | ||
type: string | ||
INSTALL_DIR: | ||
required: true | ||
type: string | ||
SEBA_TAG: | ||
required: true | ||
type: string | ||
jobs: | ||
build_wheels: | ||
name: 🛞 Build Wheels 🛞 | ||
timeout-minutes: 120 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8','3.9','3.10'] # Versions > 3.10 excluded. Reason: not supported by Everest. | ||
os: [ubuntu-latest] | ||
ert-version: ['main'] | ||
steps: | ||
- uses: actions/cache@v3 | ||
id: cache-package-check | ||
with: | ||
key: carolina_dist_${{ matrix.os }}_python-${{ matrix.python-version }}_boost-${{ inputs.BOOST_VERSION }}_dakota-${{ inputs.DAKOTA_VERSION }} | ||
path: ./carolina_dist | ||
- uses: actions/checkout@v3 | ||
if: steps.cache-package-check.outputs.cache-hit != 'true' | ||
with: | ||
fetch-depth: 0 | ||
- name: Build Linux Wheel | ||
if: steps.cache-package-check.outputs.cache-hit != 'true' | ||
uses: docker://quay.io/pypa/manylinux2014_x86_64 | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
BOOST_VERSION: ${{ inputs.BOOST_VERSION }} | ||
BOOST_VERSION_UNDERSCORES: ${{ inputs.BOOST_VERSION_UNDERSCORES }} | ||
DAKOTA_VERSION: ${{ inputs.DAKOTA_VERSION }} | ||
with: | ||
entrypoint: /bin/bash | ||
args: '-c "sh dakota_manylinux_install_files/build_wheels_gha.sh ${{ matrix.python-version }}"' | ||
- uses: actions/cache/save@v3 | ||
if: steps.cache-package-check.outputs.cache-hit != 'true' | ||
id: cache-package-store | ||
with: | ||
key: carolina_dist_${{ matrix.os }}_python-${{ matrix.python-version }}_boost-${{ inputs.BOOST_VERSION }}_dakota-${{ inputs.DAKOTA_VERSION }} | ||
path: ./carolina_dist | ||
- uses: actions/upload-artifact@v3 | ||
name: Upload wheel as artifact | ||
with: | ||
path: carolina_dist/carolina*.whl | ||
test_wheels: | ||
needs: build_wheels | ||
name: 🧪 ${{ matrix.os }}_py-${{ matrix.python-version }}_ert-${{ matrix.ert-version }}_ert | ||
timeout-minutes: 120 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8','3.9','3.10'] # Versions > 3.10 excluded. Reason: not supported by Everest. | ||
os: [ubuntu-latest] | ||
ert-version: ['main'] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
ERT_SHOW_BACKTRACE: ${{ inputs.ERT_SHOW_BACKTRACE }} | ||
NO_PROJECT_RES: ${{ inputs.NO_PROJECT_RES }} | ||
- name: Get carolina wheel from artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: artifacts | ||
- name: wheels to /local/carolina_dist | ||
run: | ||
find artifacts -type f -name carolina*.whl -exec mv {} /local/carolina_dist/ \; | ||
ls /local/carolina_dist | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up python venv | ||
run: | | ||
python -m venv myvenv | ||
- name: Install Carolina from wheel | ||
run: | | ||
source myvenv/bin/activate | ||
pyv=$(echo ${{matrix.python-version}} | sed 's/\.//g') | ||
pip install carolina_dist/carolina-1.0-cp$pyv-cp$pyv-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | ||
- name: Install other Everest dependencies | ||
run: | | ||
source myvenv/bin/activate | ||
pip install git+https://${{ secrets.DEPENDENCY_ACCESS_TOKEN }}@github.com/equinor/spinningjenny.git | ||
pip install git+https://${{ secrets.DEPENDENCY_ACCESS_TOKEN }}@github.com/TNO-Everest/seba.git@${{ inputs.SEBA_TAG }} | ||
- name: Install Everest | ||
run: | | ||
source myvenv/bin/activate | ||
git clone https://${{ secrets.DEPENDENCY_ACCESS_TOKEN }}@github.com/equinor/everest.git | ||
cd everest | ||
pip install .[test,docs] | ||
- name: Install latest ert main | ||
if: matrix.ert-version == 'main' | ||
run: | | ||
source myvenv/bin/activate | ||
sudo apt-get install build-essential | ||
pip install git+https://github.com/equinor/ert.git | ||
- name: Run Tests | ||
run: | | ||
source myvenv/bin/activate | ||
cd everest | ||
pytest tests -n 4 -m "not ui_test and not integration_test" --dist loadgroup -sv | ||
- name: Run Integration Tests | ||
run: | | ||
source myvenv/bin/activate | ||
cd everest | ||
pytest tests -n 4 -m "integration_test" --dist loadgroup | ||
- name: Build Documentation | ||
run: | | ||
source myvenv/bin/activate | ||
cd everest | ||
mkdir tmp | ||
sphinx-build -W -b html -d tmp/doctrees docs/source {envtmpdir}/html | ||
- name: Run UI Tests | ||
env: | ||
QT_QPA_PLATFORM: 'minimal' | ||
run: | | ||
source myvenv/bin/activate | ||
cd everest | ||
python -m pytest -m "ui_test" |