From fd1efa4635b053adcc55ee04758e74114797cbc2 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 6 Feb 2024 19:04:26 +0100 Subject: [PATCH] ci: Merge CI and Loadtest workflows The reason why those workflows were split in the first place was just to obtain loadtest results quicker, because the in the separated workflow, only the single loadtest job needs to finish before the artifacts can be downloaded. However, the disadvantage of this approach was, that the results were not as easily accessible as they could be in a single workflow. Additionally, it's possible to depend on the "prepopulate nix" job for efficiency if the loadtest runs in the main workflow. --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++ .github/workflows/loadtest.yaml | 43 --------------------------------- .github/workflows/report.yaml | 3 +-- 3 files changed, 28 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/loadtest.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf14ada6c..d5d0d2a8f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -109,6 +109,33 @@ jobs: run: postgrest-test-memory + Loadtest-Nix: + name: Loadtest (Nix) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Nix Environment + uses: ./.github/actions/setup-nix + with: + tools: loadtest + - uses: actions-ecosystem/action-get-latest-tag@v1 + id: get-latest-tag + with: + semver_only: true + - name: Run loadtest + run: | + postgrest-loadtest-against main ${{ steps.get-latest-tag.outputs.tag }} + postgrest-loadtest-report > loadtest/loadtest.md + - name: Upload report + uses: actions/upload-artifact@v4 + with: + name: loadtest.md + path: loadtest/loadtest.md + if-no-files-found: error + + Build-Static-Nix: name: Build Linux static (Nix) runs-on: ubuntu-latest diff --git a/.github/workflows/loadtest.yaml b/.github/workflows/loadtest.yaml deleted file mode 100644 index 96b23b0a3..000000000 --- a/.github/workflows/loadtest.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Loadtest - -on: - push: - branches: - - main - tags: - - v* - pull_request: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - # Terminate all previous runs of the same workflow and branch, except for main - cancel-in-progress: "${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}" - -jobs: - Loadtest-Nix: - name: Loadtest (Nix) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Nix Environment - uses: ./.github/actions/setup-nix - with: - tools: loadtest - - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - with: - semver_only: true - - name: Run loadtest - run: | - postgrest-loadtest-against main ${{ steps.get-latest-tag.outputs.tag }} - postgrest-loadtest-report > loadtest/loadtest.md - - name: Upload report - uses: actions/upload-artifact@v4 - with: - name: loadtest.md - path: loadtest/loadtest.md - if-no-files-found: error diff --git a/.github/workflows/report.yaml b/.github/workflows/report.yaml index e1e8e8a9f..f27adda81 100644 --- a/.github/workflows/report.yaml +++ b/.github/workflows/report.yaml @@ -2,7 +2,7 @@ name: Upload Reports on: workflow_run: - workflows: ["Loadtest"] + workflows: ["CI"] types: - completed @@ -12,7 +12,6 @@ jobs: permissions: checks: write runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Download from Artifacts uses: dawidd6/action-download-artifact@v3