Skip to content

Commit

Permalink
[INFRA] doc CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Nov 4, 2024
1 parent ba646e7 commit 1f8bea2
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 33 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0

name: Documentation

on:
push:
branches:
- 'main'
pull_request_target:
types:
- unlabeled
- closed
workflow_dispatch:

concurrency:
group: documentation-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name != 'push' }}

env:
TZ: Europe/Berlin

defaults:
run:
shell: bash -Eeuxo pipefail {0}

jobs:
build:
name: Documentation
runs-on: ubuntu-latest
if: ( github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' ) && github.event.action != 'closed'
steps:
- name: Checkout
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v4

# pull_request_target does not checkout the merge commit by default
- name: Checkout
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/merge"

- name: Install Doxygen
uses: seqan/actions/setup-doxygen@main
with:
doxygen: 1.9.4

- name: Configure tests
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-Dneedle_TEST=OFF \
-Dneedle_DOC=ON
- name: Run tests
working-directory: build
run: ctest . -j --output-on-failure

- name: Deploy Preview
if: github.event_name == 'pull_request_target'
uses: seqan/actions/documentation_deploy_preview@main
with:
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
deploy_base_path: ${{ secrets.DEPLOY_PREVIEW_BASE_PATH }}
source_path_user_doc: build/html
token: ${{ secrets.SEQAN_ACTIONS_PAT }}

- name: Deploy Documentation
if: github.event_name == 'push'
uses: seqan/actions/documentation_deploy_production@main
with:
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
source_path_user_doc: build/html/
deploy_path_user_doc: ${{ secrets.DEPLOY_PRODUCTION_BASE_PATH }}/main
delete:
name: Delete Preview
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' && github.event_name == 'pull_request_target' && github.event.action == 'closed'
steps:
- name: Delete Preview
uses: seqan/actions/documentation_delete_preview@main
with:
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
deploy_base_path: ${{ secrets.DEPLOY_PREVIEW_BASE_PATH }}
43 changes: 10 additions & 33 deletions .github/workflows/ci_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,25 @@ defaults:

jobs:
# Cancel other workflows that are dependent on this workflow by adding jobs that have the same concurrency group.
cancel_linux:
name: Cancel running Workflows
cancel_running_workflows:
name: Cancel ${{ matrix.workflow}}
strategy:
fail-fast: false
matrix:
workflow: ["linux", "macos", "coverage", "install", "documentation"]
concurrency:
group: linux-${{ github.event.pull_request.number }}
group: ${{ matrix.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: "Cancel Linux"
run: echo "Cancelling Linux"
cancel_macos:
name: Cancel running Workflows
concurrency:
group: macos-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: "Cancel macOS"
run: echo "Cancelling macOS"
cancel_coverage:
name: Cancel running Workflows
concurrency:
group: coverage-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: "Cancel Coverage"
run: echo "Cancelling Coverage"
cancel_install:
name: Cancel running Workflows
concurrency:
group: install-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: "Cancel Install"
run: echo "Cancelling Install"
- name: "Cancel ${{ matrix.workflow }}"
run: echo "Cancelling ${{ matrix.workflow }}"
lint:
name: Lint
concurrency:
group: lint-${{ github.event.pull_request.number }}
cancel-in-progress: true
needs: [cancel_linux, cancel_macos, cancel_coverage, cancel_install]
needs: cancel_running_workflows
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand Down

0 comments on commit 1f8bea2

Please sign in to comment.