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 32bc6cf commit 46db1d7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 52 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
18 changes: 7 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,17 @@ 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: ${{ matrix.container }}

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

Expand All @@ -41,8 +38,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
18 changes: 1 addition & 17 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,12 @@ on:
jobs:
check-coding-style:
runs-on: ubuntu-latest
container: fedora:41
container: ghcr.io/viennatools/vienna-builder:vtk

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

- name: 🖥️ Setup Environment
uses: ./.github/actions/setup
with:
container: ubuntu-latest
install-vtk: true

- name: 📋 Install Dependencies
run: pip install -U cmakelang pyyaml && sudo dnf install -y tmate

- name: 🐛 Debug Issues
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@v3
with:
install-dependencies: false
limit-access-to-actor: true

- name: 🔍 Check Format
run: |
cmake -B build
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ 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: ${{ matrix.container }}

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

Expand All @@ -25,8 +29,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 +68,14 @@ 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: ${{ matrix.container }}

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

Expand All @@ -79,8 +86,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 46db1d7

Please sign in to comment.