Skip to content

Merge pull request #69: Set default shell #190

Merge pull request #69: Set default shell

Merge pull request #69: Set default shell #190

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths-ignore:
- README.md
pull_request:
paths-ignore:
- README.md
workflow_dispatch:
defaults:
run:
# This is the same as GitHub Action's `bash` keyword as of 14 May 2024:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
#
# Completely spelling it out here so that GitHub can't change it out from under us
# and we don't have to refer to the docs to know the expected behavior.
shell: bash --noprofile --norc -eo pipefail {0}
jobs:
generate-version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- id: set
run: |
echo "version=$(./devel/generate-version)" | tee -a "$GITHUB_OUTPUT"
echo "label=$(./devel/label-for-ref "$GITHUB_REF")" | tee -a "$GITHUB_OUTPUT"
outputs:
version: ${{ steps.set.outputs.version }}
label: ${{ steps.set.outputs.label }}
build-and-test:
needs: generate-version
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
name: build and test (os=${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Install Micromamba
run: |
curl -fsSL --proto 'https=' https://micro.mamba.pm/install.sh | bash
echo ~/.local/bin >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- run: ./devel/setup
- run: ./devel/build
env:
VERSION: ${{ needs.generate-version.outputs.version }}
- if: always()
uses: actions/upload-artifact@v4
with:
name: build-outputs-${{ matrix.os }}
path: |
build/
locked/
- if: always()
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.os }}
path: build/locked/*/nextstrain-base-*.conda
- name: Test install of nextstrain-base
run: |
micromamba create \
--yes \
--prefix ./test-env \
--strict-channel-priority \
--override-channels \
--channel ./build/locked \
--channel conda-forge \
--channel bioconda \
nextstrain-base
- name: Generate summary
run: |
./devel/download-latest
./devel/diff-pkgs nextstrain-base-*.conda build/locked/*/nextstrain-base-*.conda \
> "$GITHUB_STEP_SUMMARY"
release:
needs:
- generate-version
- build-and-test
runs-on: ubuntu-22.04
steps:
- name: Install Micromamba
run: |
curl -fsSL --proto 'https=' https://micro.mamba.pm/install.sh | bash
echo ~/.local/bin >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- uses: actions/upload-artifact/merge@v4
with:
name: packages
pattern: packages-*
- uses: actions/download-artifact@v4
with:
name: packages
path: build/locked/
- run: ./devel/setup
- run: ./devel/upload
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
LABEL: ${{ needs.generate-version.outputs.label }}
- name: Generate summary
run: |
# Replace ${x} in Markdown with value of environment variable "x".
perl -pe 's/\$\{(.+?)\}/$ENV{$1}/ge' \
< .github/workflows/ci.release.md \
> "$GITHUB_STEP_SUMMARY"
env:
VERSION: ${{ needs.generate-version.outputs.version }}
LABEL: ${{ needs.generate-version.outputs.label }}
# Run pathogen repo CI builds with the final packages
test-pathogen-repo-ci:
needs:
- generate-version
- release
strategy:
# XXX TODO: Test on multiple platforms (os, maybe arch) via the matrix too
matrix:
include:
- { pathogen: avian-flu, build-args: test_target }
- { pathogen: ebola }
- { pathogen: lassa }
- { pathogen: mumps }
- { pathogen: ncov, build-args: all_regions -j 2 --profile nextstrain_profiles/nextstrain-ci }
- { pathogen: rsv }
- { pathogen: seasonal-flu, build-args: --configfile profiles/ci/builds.yaml -p }
# Disable some pathogens until pathogen-repo-ci supports custom build directories
# TODO: Re-enable once issue is resolved: https://github.com/nextstrain/.github/issues/63
# - { pathogen: mpox }
# - { pathogen: zika }
name: test-pathogen-repo-ci (${{ matrix.pathogen }})
uses: nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml@master
with:
repo: nextstrain/${{ matrix.pathogen }}
build-args: ${{ matrix.build-args }}
runtimes: |
- conda
env: |
NEXTSTRAIN_CONDA_CHANNEL: nextstrain/label/${{ needs.generate-version.outputs.label }}
NEXTSTRAIN_CONDA_BASE_PACKAGE: nextstrain-base ==${{ needs.generate-version.outputs.version }}
artifact-name: ${{ matrix.pathogen }}-outputs
continue-on-error: true