Skip to content

Commit

Permalink
Build wheel in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Yngve S. Kristiansen committed Oct 20, 2023
1 parent a3ed30f commit dbbed4e
Show file tree
Hide file tree
Showing 10 changed files with 955 additions and 0 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/bundle_with_dakota.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: 🏎️ Make & Test Wheels 🏎️

on: [pull_request]

env:
ERT_SHOW_BACKTRACE: 1
NO_PROJECT_RES: 1
BOOST_VERSION: 1.82.0
BOOST_VERSION_UNDERSCORES: 1_82_0
DAKOTA_VERSION: 6.18.0
INSTALL_DIR: local

jobs:
build_wheels:
name: 🛞 Build Wheels 🛞
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
python-version: ['3.8','3.9','3.10'] # 3.11 not needed at the moment
os: [ubuntu-latest]
ert-version: ['main']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/cache@v3
id: cache-package-check
with:
key: carolina_dist_${{ matrix.os }}_python-${{ matrix.python-version }}_boost-${{ env.BOOST_VERSION }}_dakota-${{ env.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: ${{ env.BOOST_VERSION }}
BOOST_VERSION_UNDERSCORES: ${{ env.BOOST_VERSION_UNDERSCORES }}
DAKOTA_VERSION: ${{ env.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-${{ env.BOOST_VERSION }}_dakota-${{ env.DAKOTA_VERSION }}
path: ./carolina_dist

- name: Get Carolina wheel from cache
uses: actions/cache/restore@v3
id: restore-cached-package
with:
key: carolina_dist_${{ matrix.os }}_python-${{ matrix.python-version }}_boost-${{ env.BOOST_VERSION }}_dakota-${{ env.DAKOTA_VERSION }}
path: /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@6.12.0
- 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"
- name: Upload wheel as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }} Python ${{ matrix.python-version }} wheel
path: |
dist/*
trace/*
55 changes: 55 additions & 0 deletions .github/workflows/test_repo_access.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 🤠 Test repo access 🤠

on: [pull_request]

jobs:
clone_it:
name: 🤠 Download private repos 🤠
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: "DL Seba"
run: git clone https://${{ secrets.DEPENDENCY_ACCESS_TOKEN }}@github.com/TNO-Everest/seba.git

- name: "DL spinningjenny"
run: git clone https://${{ secrets.DEPENDENCY_ACCESS_TOKEN }}@github.com/equinor/spinningjenny.git

- name: "DL Everest"
run: git clone https://${{ secrets.DEPENDENCY_ACCESS_TOKEN }}@github.com/equinor/everest.git

- name: "Clear CWD"
run: |
rm -rf everest
rm -rf seba
rm -rf spinningjenny
- name: "DL Seba from docker"
uses: docker://quay.io/pypa/manylinux2014_x86_64
env:
DEPENDENCY_ACCESS_TOKEN: ${{ secrets.DEPENDENCY_ACCESS_TOKEN }}
with:
entrypoint: /bin/bash
args: '-c "git clone https://$DEPENDENCY_ACCESS_TOKEN@github.com/TNO-Everest/seba.git"'

- name: "DL spinningjenny from docker"
uses: docker://quay.io/pypa/manylinux2014_x86_64
env:
DEPENDENCY_ACCESS_TOKEN: ${{ secrets.DEPENDENCY_ACCESS_TOKEN }}
with:
entrypoint: /bin/bash
args: '-c "git clone https://$DEPENDENCY_ACCESS_TOKEN@github.com/equinor/spinningjenny.git"'

- name: "DL Everest from docker"
uses: docker://quay.io/pypa/manylinux2014_x86_64
env:
DEPENDENCY_ACCESS_TOKEN: ${{ secrets.DEPENDENCY_ACCESS_TOKEN }}
with:
entrypoint: /bin/bash
args: '-c "git clone https://$DEPENDENCY_ACCESS_TOKEN@github.com/equinor/everest.git"'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
build
src/**egg-info/**
**/__pycache__/**
trace
dist
Loading

0 comments on commit dbbed4e

Please sign in to comment.