Skip to content

Commit

Permalink
Merge pull request #3273 from seqan/infra/preview
Browse files Browse the repository at this point in the history
[INFRA] Documentation preview
  • Loading branch information
eseiler authored Jul 19, 2024
2 parents c7ff420 + 4252d1f commit ac6de55
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 90 deletions.
50 changes: 47 additions & 3 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:
push:
branches:
- 'main'
pull_request:
pull_request_target:
types:
- unlabeled
- closed
workflow_dispatch:

concurrency:
Expand All @@ -29,11 +30,19 @@ jobs:
build:
name: Documentation
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
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:
Expand All @@ -43,8 +52,43 @@ jobs:
run: |
mkdir build && cd build
cmake ../test/documentation
make download-cppreference-doxygen-web-tag
- 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/doc_usr/html
source_path_developer_doc: build/doc_dev/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/doc_usr/html/
deploy_path_user_doc: ${{ secrets.DEPLOY_PRODUCTION_BASE_PATH }}/main_user
source_path_developer_doc: build/doc_dev/html/
deploy_path_developer_doc: ${{ secrets.DEPLOY_PRODUCTION_BASE_PATH }}/main_dev
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 }}
81 changes: 0 additions & 81 deletions .github/workflows/deploy_documentation.yaml

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/update_cookbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- 'main'

concurrency:
group: update-cookbook-${{ github.ref }}
cancel-in-progress: true

env:
TZ: Europe/Berlin

Expand All @@ -19,10 +23,8 @@ defaults:
jobs:
update-cookbook:
name: Update Cookbook
concurrency:
group: update-cookbook-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-22.04
if: github.repository_owner == 'seqan'
timeout-minutes: 15
steps:
- name: Checkout SeqAn3
Expand Down
1 change: 1 addition & 0 deletions test/documentation/doc_dev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ message (STATUS "Add dev doc test.")
add_test (NAME doc_dev_no_warnings_test
COMMAND bash -c "${SEQAN3_TEST_DOXYGEN_FAIL_ON_WARNINGS}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set_tests_properties (doc_dev_no_warnings_test PROPERTIES DEPENDS cppreference-doxygen-web-tag)
1 change: 1 addition & 0 deletions test/documentation/doc_usr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ enable_testing ()

message (STATUS "Add user doc test.")
add_test (NAME doc_usr_no_warnings_test COMMAND bash -c "${SEQAN3_TEST_DOXYGEN_FAIL_ON_WARNINGS}")
set_tests_properties (doc_usr_no_warnings_test PROPERTIES DEPENDS cppreference-doxygen-web-tag)
4 changes: 3 additions & 1 deletion test/documentation/seqan3-doxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ else ()
endif ()

### TEST HELPER
add_test (NAME cppreference-doxygen-web-tag COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target
download-cppreference-doxygen-web-tag)

# doxygen does not show any warnings (doxygen prints warnings / errors to cerr)
set (SEQAN3_TEST_DOXYGEN_FAIL_ON_WARNINGS
"${DOXYGEN_EXECUTABLE} > doxygen.cout 2> doxygen.cerr; cat \"doxygen.cerr\"; test ! -s \"doxygen.cerr\""
"${DOXYGEN_EXECUTABLE} -q > doxygen.cout 2> doxygen.cerr; cat \"doxygen.cerr\"; test ! -s \"doxygen.cerr\""
CACHE INTERNAL "The doxygen test command")

### install helper
Expand Down
2 changes: 1 addition & 1 deletion test/documentation/seqan3_doxygen_cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
NUM_PROC_THREADS = 1
NUM_PROC_THREADS = 0
TIMESTAMP = YES
#---------------------------------------------------------------------------
# Build related configuration options
Expand Down
2 changes: 1 addition & 1 deletion test/documentation/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function addVersionSelection(arr)
version_select.addEventListener("change", function(){changeVersion(this.id);}, false);

// current selection is..
cur_sel = window.location.pathname.split("/")[2];
cur_sel = window.location.pathname.split("/").at(-2);

for(i=0; i < arr.length; ++i)
{
Expand Down
2 changes: 2 additions & 0 deletions test/documentation/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
$list = array();
foreach( $files as $file )
{
if( !is_dir("$LOCALDIR/$file") ) // Skip files
continue;
if( strpos($file, "hidden_") !== FALSE ) // Skip directories starting with "hidden_"
continue;
if( $file[0] == "." ) // Skip current directory
Expand Down

0 comments on commit ac6de55

Please sign in to comment.