Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run conda-build also on main CI #402

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on:
workflow_call:

defaults:
run:
shell: bash -l {0} # required for conda env

jobs:
build_conda:
name: Conda build
runs-on: 'ubuntu-22.04'

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # history required so setuptools_scm can determine version

- uses: mamba-org/setup-micromamba@v1
with:
environment-name: build-env
create-args: >-
conda-build
boa
- run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda

- uses: actions/upload-artifact@v4
with:
name: conda-package-noarch
path: conda/package/noarch/*.tar.bz2

build_wheels:
name: Wheels
runs-on: 'ubuntu-22.04'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # history required so setuptools_scm can determine version

- uses: actions/setup-python@v5
with:
python-version-file: '.github/workflows/python-version-ci'

- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/wheels.txt

- name: Build wheels
run: python -m build

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
58 changes: 0 additions & 58 deletions .github/workflows/ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
ref: ${{ inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 # history required so cmake can determine version
- uses: actions/setup-python@v5
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Formatting

on:
workflow_call:

jobs:
formatting:
name: Static analysis
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: '.github/workflows/python-version-ci'
- uses: pre-commit/[email protected]
with:
extra_args: --all-files
- uses: pre-commit-ci/[email protected]
if: always()
with:
msg: Apply automatic formatting
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Main

on:
push:
branches:
- main

jobs:
setup:
uses: ./.github/workflows/setup.yml

formatting:
uses: ./.github/workflows/formatting.yml

tests:
name: Tests
needs: [setup, formatting]
# strategy:
# matrix:
# os: ['ubuntu-22.04']
# python:
# - version: '${{needs.setup.outputs.min_python}}'
# tox-env: '${{needs.setup.outputs.min_tox_env}}'
uses: ./.github/workflows/test.yml
with:
# os-variant: ${{ matrix.os }}
python-version: ${{ needs.setup.outputs.min_python }}
tox-env: 'test' # ${{ matrix.python.tox-env }}
secrets: inherit

docs:
needs: tests
uses: ./.github/workflows/docs.yml
with:
publish: false
linkcheck: true
secrets: inherit

build_packages:
needs: tests
uses: ./.github/workflows/build.yml
36 changes: 18 additions & 18 deletions .github/workflows/nightly_at_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ on:

jobs:
setup:
name: Setup variables
runs-on: 'ubuntu-22.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
steps:
- uses: actions/checkout@v4
- name: Get Python version for other CI jobs
id: vars
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
uses: ./.github/workflows/setup.yml

tests:
name: Tests
needs: setup
strategy:
matrix:
os: ['ubuntu-22.04']
python:
- version: '${{needs.setup.outputs.min_python}}'
tox-env: 'nightly'
# strategy:
# matrix:
# os: ['ubuntu-22.04']
# python:
# - version: '${{needs.setup.outputs.min_python}}'
# tox-env: 'nightly'
uses: ./.github/workflows/test.yml
with:
os-variant: ${{ matrix.os }}
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
# os-variant: ${{ matrix.os }}
python-version: ${{ needs.setup.outputs.min_python }}
tox-env: 'test' # ${{ matrix.python.tox-env }}
secrets: inherit

docs:
needs: tests
uses: ./.github/workflows/docs.yml
with:
publish: false
linkcheck: false
secrets: inherit
49 changes: 25 additions & 24 deletions .github/workflows/nightly_at_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,36 @@ on:

jobs:
setup:
name: Setup variables
runs-on: 'ubuntu-22.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
release_tag: ${{ steps.release.outputs.release_tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # history required so we can determine latest release tag
- name: Get last release tag from git
id: release
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT
- name: Get Python version for other CI jobs
id: vars
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT
uses: ./.github/workflows/setup.yml
# name: Setup variables
# runs-on: 'ubuntu-22.04'
# outputs:
# min_python: ${{ steps.vars.outputs.min_python }}
# release_tag: ${{ steps.release.outputs.release_tag }}
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0 # history required so we can determine latest release tag
# - name: Get last release tag from git
# id: release
# run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT
# - name: Get Python version for other CI jobs
# id: vars
# run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT

tests:
name: Tests
needs: setup
strategy:
matrix:
os: ['ubuntu-22.04']
python:
- version: '${{needs.setup.outputs.min_python}}'
tox-env: 'nightly'
# strategy:
# matrix:
# os: ['ubuntu-22.04']
# python:
# - version: '${{needs.setup.outputs.min_python}}'
# tox-env: 'nightly'
uses: ./.github/workflows/test.yml
with:
os-variant: ${{ matrix.os }}
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
# os-variant: ${{ matrix.os }}
python-version: ${{ needs.setup.outputs.min_python }}
tox-env: 'test' # ${{ matrix.python.tox-env }}
checkout_ref: ${{ needs.setup.outputs.release_tag }}
secrets: inherit
35 changes: 35 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pull Request

on:
pull_request:

jobs:
setup:
uses: ./.github/workflows/setup.yml

formatting:
# needs: setup
uses: ./.github/workflows/formatting.yml

tests:
needs: [setup, formatting]
# strategy:
# matrix:
# os: ['ubuntu-22.04']
# python:
# - version: '${{needs.setup.outputs.min_python}}'
# tox-env: '${{needs.setup.outputs.min_tox_env}}'
uses: ./.github/workflows/test.yml
with:
# os-variant: ${{ matrix.os }}
python-version: ${{ needs.setup.outputs.min_python }}
tox-env: 'test' #${{ matrix.python.tox-env }}
secrets: inherit

docs:
needs: tests
uses: ./.github/workflows/docs.yml
with:
publish: false
linkcheck: false
secrets: inherit
Loading