[pre-commit.ci] pre-commit autoupdate #1552
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: Construct | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
cancel-in-progress: true | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# Build installers | |
build_macos: | |
name: Build (${{ matrix.os }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-12, macos-14] # Intel and Apple Silicon, respectively | |
runs-on: ${{ matrix.os }} | |
env: | |
GITHUB_EVENT_NAME: ${{ github.event_name }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
- run: ./tools/extract_version.sh | |
- run: ./tools/macos_install_certificates.sh | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
APPLICATION_CERT_BASE64: ${{ secrets.APPLE_APPLICATION_CERT_BASE64 }} | |
APPLICATION_CERT_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }} | |
INSTALLER_CERT_BASE64: ${{ secrets.APPLE_INSTALLER_CERT_BASE64 }} | |
INSTALLER_CERT_PASSWORD: ${{ secrets.APPLE_INSTALLER_CERT_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} | |
- name: Patch config (non-PR) | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
sed -i "" "s/_name: *# \[osx\]/_name: 9779L28NP8 # \[osx\]/" ${RECIPE_DIR}/construct.yaml | |
- run: ./tools/run_constructor.sh | |
timeout-minutes: 20 | |
- run: ./tools/macos_check_installer_signature.sh | |
- run: ./tools/macos_notarize_installer.sh | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
- run: ./tools/calculate_installer_hash.sh | |
- run: | | |
installer -verbose -pkginfo -pkg ./${MNE_INSTALLER_NAME} | |
installer -verbose -dominfo -pkg ./${MNE_INSTALLER_NAME} | |
installer -verbose -volinfo -pkg ./${MNE_INSTALLER_NAME} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }} | |
path: MNE-Python-*.* | |
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
build_linux: | |
name: Build (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
- run: ./tools/extract_version.sh | |
- run: ./tools/run_constructor.sh | |
timeout-minutes: 20 | |
- run: ./tools/calculate_installer_hash.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }} | |
path: MNE-Python-*.* | |
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
build_windows: | |
name: Build (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2019] | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
- run: conda install -c conda-forge -y "nsis==3.08" | |
- run: ./tools/extract_version.sh | |
- run: ./tools/run_constructor.sh | |
timeout-minutes: 20 | |
- run: ./tools/calculate_installer_hash.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }} | |
path: MNE-Python-*.* | |
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
# Test | |
test_macos: | |
name: Test (${{ matrix.os }}) | |
needs: [build_macos] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-12, macos-13, macos-14] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
# The macos-14 runner doesn't come equipped with Python, so we need to install it | |
# there. | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
if: ${{ matrix.os == 'macos-14' }} | |
- run: ./tools/extract_version.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }} | |
- name: Run installer | |
run: | | |
sudo installer -verbose -pkg ${MNE_INSTALLER_NAME} -target / \ | |
|| ( tail -n 30 /var/log/install.log && exit 1 ) # display last log messages on error | |
- run: ./tools/export_frozen_env_def.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }}-json | |
path: MNE-Python-*.env.json | |
# upload just one for each installer version | |
if: matrix.os == 'macos-13' || matrix.os == 'macos-14' | |
- uses: pyvista/setup-headless-display-action@main | |
with: | |
qt: true | |
pyvista: false | |
- run: ./tools/check_installation.sh | |
test_linux: | |
name: Test (${{ matrix.os }}) | |
needs: [build_linux] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ./tools/extract_version.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }} | |
- run: sh ./${MNE_INSTALLER_NAME} -b | |
- run: ./tools/export_frozen_env_def.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }}-json | |
path: MNE-Python-*.env.json | |
# upload just one for each installer version | |
if: matrix.os == 'ubuntu-24.04' | |
- uses: pyvista/setup-headless-display-action@main | |
with: | |
qt: true | |
pyvista: false | |
- run: ./tools/check_installation.sh | |
test_windows: | |
needs: [build_windows] | |
name: Test (${{ matrix.os }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2019, windows-2022] | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ./tools/extract_version.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }} | |
# https://docs.anaconda.com/anaconda/install/silent-mode.html#windows | |
- run: .\%MNE_INSTALLER_NAME% /S /InstallationType=JustMe /AddToPath=1 | |
timeout-minutes: 30 | |
shell: cmd | |
- run: ./tools/export_frozen_env_def.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.MNE_INSTALLER_ARTIFACT_ID }}-json | |
path: MNE-Python-*.env.json | |
# upload just one for each installer version | |
if: matrix.os == 'windows-2022' | |
- uses: pyvista/setup-headless-display-action@main | |
with: | |
qt: true | |
pyvista: false | |
- run: ./tools/check_installation.sh | |
timeout-minutes: 5 # < 2 min even on Windows | |
# Release | |
release: | |
name: Release | |
needs: [build_macos, build_linux, build_windows, test_macos, test_linux, test_windows] | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
# These names should correspond to MNE_INSTALLER_ARTIFACT_ID in tools/extract_version.sh | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: MNE-Python-* | |
merge-multiple: true | |
- run: ls -al ./ | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "MNE-Python-*.*" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
prerelease: true | |
allowUpdates: true | |
generateReleaseNotes: true | |
if: github.ref_type == 'tag' |