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: Test Build of conda packages | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ "*" ] | |
# pull_request: | |
# branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
# workflow_dispatch: | |
jobs: | |
conda_build_and_install: | |
name: Test conda deployment of package with Python 3.12 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out a copy of the repository | |
uses: actions/checkout@v4 | |
- name: Conda environment creation and activation | |
uses: ./.github/actions/setup-conda | |
- name: Build package | |
run: conda build --no-copy-test-source-files recipe.local --output-folder ./conda_package | |
- name: create fresh conda env | |
run: conda create -n test_env python=3.12 | |
- name: conda init | |
run: source /usr/share/miniconda/etc/profile.d/conda.sh | |
- name: activate conda env | |
run: conda activate test_env | |
- name: Install package | |
run: conda install -c ./conda_package acoular | |
- name: Check import of package | |
run: python -c "import acoular" | |
- name: Upload conda package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: conda-package | |
path: ./conda_package | |
conda_deploy: | |
needs : conda_build_and_install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: conda-package | |
path: ./conda_package | |
alls-green: | |
name: Conda green? | |
if: always() | |
needs: | |
- conda_build_and_install | |
- conda_deploy | |
runs-on: ubuntu-latest | |
steps: | |
- id: workaround | |
uses: actions/github-script@v7 | |
with: | |
# Workaround for https://github.com/re-actors/alls-green/issues/29 | |
# we strip outputs from the needs object to avoid nested JSON | |
result-encoding: string | |
script: | | |
return JSON.stringify(Object.fromEntries(Object.entries(${{ toJSON(needs) }}) | |
.map(([name, { result }]) => [name, { result, outputs: {} }]))); | |
- name: All checks passed? | |
uses: re-actors/[email protected] | |
with: | |
jobs: ${{ steps.workaround.outputs.result }} | |
allowed-failures: conda_deploy | |