Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@ name: "Nightly"
# requests of this repository use.
#
# Triggers:
# - schedule: after the nightly of OpenMS (its update_nightly workflow starts at
# 01:07 UTC and its release workflow publishes the installers about an hour
# later).
# - repository_dispatch, event type 'openms-core-nightly': OpenMS can start this
# workflow at the end of its nightly release workflow, e.g.
# - schedule: the source build and tests against OpenMS develop (job 'test'), which
# also refreshes the cached core of the pull requests.
# - repository_dispatch, event type 'openms-core-nightly': sent by the release
# workflow of OpenMS (job trigger-gui-nightly) once it has uploaded the OpenMS
# nightly installers, and only then. This builds and deploys the nightly
# installers of the GUI layer (release.yml) on top of them. OpenMS makes no
# nightly on a day without a new commit on develop, or when its release fails;
# the GUI then makes none either, instead of waiting for an archive folder that
# never appears. To send it by hand:
# gh api repos/OpenMS/OpenMS-TOPP-GUI/dispatches \
# -f event_type=openms-core-nightly
# with a token that may dispatch workflows in this repository. client_payload.ref
# (optional, e.g. -f 'client_payload[ref]=develop') is the OpenMS branch, tag or
# commit to build (default: develop). Only a build of develop is the cached core
# of the pull requests; a commit gets a cache entry of its own and a full version
# string without a branch name.
# - workflow_dispatch.
#
# Automatic runs build and deploy the nightly installers (release.yml) on top of
# the OpenMS nightly installers of the same day. Manual runs can opt in below.
# with a token that may dispatch workflows in this repository. OpenMS sends
# client_payload.version, the date YYYY.MM.DD of its nightly (default: the date of
# this run): the installers are built on that folder of the archive and uploaded
# next to it, also when the run starts after midnight UTC. An optional
# client_payload.ref (e.g. -f 'client_payload[ref]=develop') also runs the
# source build and tests against that OpenMS branch, tag or commit. Only a build
# of develop is the cached core of the pull requests; a commit gets a cache entry
# of its own and a full version string without a branch name.
# - workflow_dispatch: the source build and tests; the installers only if asked.
on:
schedule:
- cron: "23 4 * * *"
Expand All @@ -42,13 +46,19 @@ on:
permissions:
contents: read

# One run of each kind at a time, the next one waiting: the source builds (they refresh
# the cached core) and the installer-only dispatches. One group for both would let a
# waiting run of the one kind replace a waiting run of the other (GitHub keeps one
# pending run per group), and that day's test or installers would be lost.
concurrency:
group: nightly-openms-core
group: nightly-openms-core-${{ (github.event_name == 'repository_dispatch' && !github.event.client_payload.ref) && 'installers' || 'test' }}
cancel-in-progress: false

jobs:
test:
name: "Test against OpenMS ${{ inputs.core_ref || github.event.client_payload.ref || 'develop' }}"
# the dispatch from the OpenMS release is for the installers; the schedule tests develop
if: ${{ github.event_name != 'repository_dispatch' || github.event.client_payload.ref }}
uses: ./.github/workflows/test.yml
with:
core_mode: source
Expand All @@ -58,10 +68,12 @@ jobs:

installers:
name: "Nightly Installers"
if: ${{ github.event_name != 'workflow_dispatch' || inputs.installers }}
# only on top of OpenMS nightly installers that exist (see Triggers above)
if: ${{ github.event_name == 'repository_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.installers) }}
uses: ./.github/workflows/release.yml
permissions:
contents: write
with:
deploy: true
core_version: ${{ github.event.client_payload.version || '' }}
secrets: inherit
38 changes: 35 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ name: "Release"
# tag of this repository, otherwise the branch nightly (the commit of today's
# OpenMS nightly installers), unless the input core_ref says otherwise. The smoke
# test takes the OpenMS installer of the same version from the archive server
# (release/X.Y.Z, or nightly/<date of this run>).
# (release/X.Y.Z, or nightly/<date>). The date is the input core_version when given
# (nightly.yml passes the date of the OpenMS nightly that started it), otherwise the
# date of this run.
on:
workflow_dispatch:
inputs:
Expand All @@ -29,6 +31,10 @@ on:
description: "Where the OpenMS core comes from: source, sdk, or empty for the default of the openms-core action"
type: string
default: ""
core_version:
description: "Nightly builds: the date YYYY.MM.DD of the OpenMS nightly to build on (default: today)"
type: string
default: ""
# used by nightly.yml for the nightly installers
workflow_call:
inputs:
Expand All @@ -41,6 +47,9 @@ on:
core_mode:
type: string
default: ""
core_version:
type: string
default: ""
push:
tags:
- 'v[0-9]*'
Expand All @@ -54,8 +63,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
has_version: ${{ steps.version.outputs.has_version }}
version: ${{ steps.version.outputs.version }}
version_name: ${{ steps.version.outputs.name }}
version: ${{ steps.nightly.outputs.version || steps.version.outputs.version }}
version_name: ${{ steps.nightly.outputs.name || steps.version.outputs.name }}
version_type: ${{ steps.version.outputs.type }}
core_ref: ${{ steps.core.outputs.ref }}
core_channel: ${{ steps.core.outputs.channel }}
Expand All @@ -70,6 +79,29 @@ jobs:
id: version
uses: ./.github/actions/version

# The folder nightly/<date> of the OpenMS nightly that started this run. The date of
# this run would name the next day's folder after midnight UTC, which does not exist yet.
- name: Take the Date of the OpenMS Nightly
id: nightly
if: inputs.core_version != ''
shell: bash
env:
CORE_VERSION: ${{ inputs.core_version }}
TYPE: ${{ steps.version.outputs.type }}
run: |
if [[ ! "$CORE_VERSION" =~ ^[0-9]{4}\.[0-9]{2}\.[0-9]{2}$ ]]; then
echo >&2 "ERROR: core_version '$CORE_VERSION' is not a nightly date YYYY.MM.DD"
exit 1
fi
if [[ "$TYPE" != nightly ]]; then
echo >&2 "ERROR: core_version is for nightly builds, this is a build of type '$TYPE'"
exit 1
fi
{
echo "version=$CORE_VERSION"
echo "name=nightly-$CORE_VERSION"
} | tee -a "$GITHUB_OUTPUT"

- name: Choose the OpenMS Core
id: core
shell: bash
Expand Down
Loading