Skip to content

Commit

Permalink
refactor(ci): revamp workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed May 23, 2024
1 parent 3ce01c5 commit a7aff8f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 42 deletions.
18 changes: 2 additions & 16 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ name: 🏗️ Setup Environment
description: Install Dependencies & Deploy Workarounds

inputs:
container:
os:
required: true
description: Build container used

install-vtk:
required: true
description: Wether or not to install VTK as a system dependency
description: Operating System used

runs:
using: "composite"
Expand All @@ -22,19 +18,9 @@ runs:
- name: 🖥️ Enable MSVC Dev Console
uses: ilammy/msvc-dev-cmd@v1

- name: 📋 Install Dependencies
shell: bash
if: ${{ inputs.container == 'ubuntu-latest' }}
run: dnf install -y gcc gcc-c++ kernel-devel cmake ninja-build git docker sed clang-tools-extra

- name: 📋 Install OpenMP
shell: bash
if: ${{ inputs.container == 'macos-latest' }}
run: |
brew reinstall --build-from-source --formula ./.github/homebrew/libomp.rb
echo "OpenMP_ROOT=$(brew --prefix)/opt/libomp" >> $GITHUB_ENV
- name: 📋 Install VTK
shell: bash
if: ${{ inputs.install-vtk == 'true' }}
run: dnf install -y vtk vtk-devel
23 changes: 12 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ jobs:

os:
- macos-latest
- ubuntu-latest
- windows-latest

vtk-system: [true, false]
include:
- os: ubuntu-latest
container: ghcr.io/viennatools/vienna-builder:vtk

exclude:
- os: macos-latest
vtk-system: true

- os: windows-latest
vtk-system: true
- os: ubuntu-latest
container: ghcr.io/viennatools/vienna-builder:stock

runs-on: ${{ matrix.os }}
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }}

container:
image: ${{ matrix.container }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

name: '🧪 Test on ${{ matrix.os }} ["${{ matrix.config }}", VTK: "${{ matrix.vtk-system }}"]'

Expand All @@ -41,8 +43,7 @@ jobs:
- name: 🖥️ Setup Environment
uses: ./.github/actions/setup
with:
container: ${{ matrix.os }}
install-vtk: ${{ matrix.vtk-system }}
os: ${{ matrix.os }}

- name: 🦥 Cache Dependencies
uses: actions/cache@v4
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ on:
jobs:
check-coding-style:
runs-on: ubuntu-latest
container: fedora:41

steps:
- name: 🖥️ Setup Environment
uses: ./.github/actions/setup
with:
container: ubuntu-latest
install-vtk: true
container:
image: ghcr.io/viennatools/vienna-builder:vtk
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: 📥 Checkout
uses: actions/checkout@v4

Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ jobs:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
container: ghcr.io/viennatools/vienna-builder:stock
- os: windows-latest
- os: macos-latest

runs-on: ${{ matrix.os }}
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }}

container:
image: ${{ matrix.container }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

name: "🐍 Test Bindings on ${{ matrix.os }}"

Expand All @@ -25,8 +34,7 @@ jobs:
- name: 🖥️ Setup Environment
uses: ./.github/actions/setup
with:
container: ${{ matrix.os }}
install-vtk: false
os: ${{ matrix.os }}

- name: 🐍 Setup Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -65,10 +73,19 @@ jobs:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
container: ghcr.io/viennatools/vienna-builder:stock
- os: windows-latest
- os: macos-latest

runs-on: ${{ matrix.os }}
container: ${{ matrix.os == 'ubuntu-latest' && 'fedora:38' || null }}

container:
image: ${{ matrix.container }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

name: "🐍 Package Bindings on ${{ matrix.os }}"

Expand All @@ -79,8 +96,7 @@ jobs:
- name: 🖥️ Setup Environment
uses: ./.github/actions/setup
with:
container: ${{ matrix.os }}
install-vtk: false
os: ${{ matrix.os }}

- name: 🐍 Setup Python
uses: actions/setup-python@v5
Expand Down

0 comments on commit a7aff8f

Please sign in to comment.