From 15bd9b07153c740c4bf226a5408c822cd649b711 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Wed, 28 Feb 2024 12:02:58 +0100 Subject: [PATCH] feat(ci): add workflow dispatch to allow debugging of individual workflows (#1166) Also format workflows consistently with yaml formatter --- .github/workflows/backend.yml | 1 + .../workflows/config-preprocessor-build.yml | 1 + .github/workflows/docs-build.yml | 27 ++++----- .github/workflows/docs-deploy.yml | 48 ++++++++-------- .github/workflows/dummyPreprocessing.yml | 1 + .../workflows/format-website-on-dispatch.yml | 36 ++++++------ .github/workflows/node_dev.yml | 55 ++++++++++--------- .../workflows/preprocessing-nextclade.yaml | 1 + .github/workflows/update-argocd-metadata.yml | 1 + .github/workflows/website.yml | 1 + 10 files changed, 90 insertions(+), 82 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index ceb9e5def..85a1c8b8a 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -2,6 +2,7 @@ name: backend on: push: + workflow_dispatch: env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/backend diff --git a/.github/workflows/config-preprocessor-build.yml b/.github/workflows/config-preprocessor-build.yml index 061f76893..3aa02ae51 100644 --- a/.github/workflows/config-preprocessor-build.yml +++ b/.github/workflows/config-preprocessor-build.yml @@ -2,6 +2,7 @@ name: config-processor-build on: push: + workflow_dispatch: env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/config-processor diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 40778c479..c6038bbe5 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -3,25 +3,26 @@ name: Docs Build Check on: push: paths: - - 'docs/**' + - "docs/**" + workflow_dispatch: jobs: check-docs-build: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - name: Checkout Repository + uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20' + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" - - name: Install Dependencies - run: npm install - working-directory: ./docs + - name: Install Dependencies + run: npm install + working-directory: ./docs - - name: Check Build - run: npm run build - working-directory: ./docs + - name: Check Build + run: npm run build + working-directory: ./docs diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index f45c746e0..f60fbbd4a 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -13,27 +13,27 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20' - - - name: Navigate to docs directory - run: cd docs - - - name: Install Dependencies - run: npm install - working-directory: ./docs - - - name: Build Project - run: npm run build - working-directory: ./docs - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/dist # Adjust if your build output directory is different + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" + + - name: Navigate to docs directory + run: cd docs + + - name: Install Dependencies + run: npm install + working-directory: ./docs + + - name: Build Project + run: npm run build + working-directory: ./docs + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/dist # Adjust if your build output directory is different diff --git a/.github/workflows/dummyPreprocessing.yml b/.github/workflows/dummyPreprocessing.yml index 49002b338..d213e2364 100644 --- a/.github/workflows/dummyPreprocessing.yml +++ b/.github/workflows/dummyPreprocessing.yml @@ -2,6 +2,7 @@ name: preprocessing-dummy on: push: + workflow_dispatch: env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/preprocessing-dummy diff --git a/.github/workflows/format-website-on-dispatch.yml b/.github/workflows/format-website-on-dispatch.yml index ff1f96db3..1f2bf976f 100644 --- a/.github/workflows/format-website-on-dispatch.yml +++ b/.github/workflows/format-website-on-dispatch.yml @@ -10,24 +10,24 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 + - name: Checkout Repository + uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20' + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" - - name: NPM install and format website - working-directory: website - run: | - npm install - npm run format + - name: NPM install and format website + working-directory: website + run: | + npm install + npm run format - - name: Commit and Push Changes - run: | - git config --global user.name 'Loculus bot' - git config --global user.email 'bot@loculus.org' - git add -A - git commit -m "Automated code formatting" || echo "No changes to commit" - git push + - name: Commit and Push Changes + run: | + git config --global user.name 'Loculus bot' + git config --global user.email 'bot@loculus.org' + git add -A + git commit -m "Automated code formatting" || echo "No changes to commit" + git push diff --git a/.github/workflows/node_dev.yml b/.github/workflows/node_dev.yml index dad74cb2d..4d18a55c1 100644 --- a/.github/workflows/node_dev.yml +++ b/.github/workflows/node_dev.yml @@ -3,8 +3,10 @@ name: Dev server test on: push: paths: - - 'website/**' - - 'deploy.py' + - "website/**" + - "deploy.py" + workflow_dispatch: + jobs: test: runs-on: ${{ matrix.os }} @@ -12,29 +14,28 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - - uses: azure/setup-helm@v3 - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install yaml package - run: pip install PyYAML requests + - uses: azure/setup-helm@v3 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install yaml package + run: pip install PyYAML requests + + - name: Generate local test config + run: ./generate_local_test_config.sh + + - name: Install dependencies + working-directory: website + run: | + npm install + npm install playwright --save-dev + + - name: Test dev node server + working-directory: website + run: | + npm run start & + npx playwright install chromium + - - name: Generate local test config - run: ./generate_local_test_config.sh - - - name: Install dependencies - working-directory: website - run: | - npm install - npm install playwright --save-dev - - - name: Test dev node server - working-directory: website - run: | - npm run start & - npx playwright install chromium - - - npx playwright screenshot localhost:3000 test.png - sleep 5 - npx playwright screenshot localhost:3000 test.png - + npx playwright screenshot localhost:3000 test.png + sleep 5 + npx playwright screenshot localhost:3000 test.png diff --git a/.github/workflows/preprocessing-nextclade.yaml b/.github/workflows/preprocessing-nextclade.yaml index 7a3ca7596..8badb93e4 100644 --- a/.github/workflows/preprocessing-nextclade.yaml +++ b/.github/workflows/preprocessing-nextclade.yaml @@ -2,6 +2,7 @@ name: preprocessing-nextclade on: push: + workflow_dispatch: env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/preprocessing-nextclade diff --git a/.github/workflows/update-argocd-metadata.yml b/.github/workflows/update-argocd-metadata.yml index d80fa38ec..d38abf7c6 100644 --- a/.github/workflows/update-argocd-metadata.yml +++ b/.github/workflows/update-argocd-metadata.yml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_dispatch: jobs: update: diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index a048c42a0..f2dd5d8d6 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -2,6 +2,7 @@ name: website on: push: + workflow_dispatch: env: DOCKER_IMAGE_NAME: ghcr.io/loculus-project/website