From 1527290ce38836f0031cb68fdd410fb665e8b705 Mon Sep 17 00:00:00 2001 From: Bukowa Date: Sat, 29 Jun 2024 13:33:48 +0200 Subject: [PATCH] ci: split tests per os for badges https://github.com/orgs/community/discussions/52616#discussioncomment-9364532 --- .../{tests-e2e-js.yaml => main.yaml} | 64 +++++++------------ .github/workflows/tests-linux.yaml | 17 +++++ .github/workflows/tests-macos.yaml | 17 +++++ .github/workflows/tests-windows.yaml | 17 +++++ 4 files changed, 75 insertions(+), 40 deletions(-) rename .github/workflows/{tests-e2e-js.yaml => main.yaml} (50%) create mode 100644 .github/workflows/tests-linux.yaml create mode 100644 .github/workflows/tests-macos.yaml create mode 100644 .github/workflows/tests-windows.yaml diff --git a/.github/workflows/tests-e2e-js.yaml b/.github/workflows/main.yaml similarity index 50% rename from .github/workflows/tests-e2e-js.yaml rename to .github/workflows/main.yaml index d42b849..2ce3939 100644 --- a/.github/workflows/tests-e2e-js.yaml +++ b/.github/workflows/main.yaml @@ -1,42 +1,27 @@ name: "Test: UI E2E JS" on: - schedule: - - cron: "20 04 * * *" - push: - branches: - - master - pull_request: - branches: - - master - workflow_call: workflow_dispatch: + workflow_call: + inputs: + os: + description: "Operating system" + type: string + required: true + default: "ubuntu-latest" env: - TESTS_LOG_LEVEL: debug - # xvfb is slow to start - NODE_TEST_TIMEOUT: 90000 - TRACE: 1 + TRACE: 1 # justfile set -x + TESTS_LOG_LEVEL: debug # tests-e2e-js + NODE_TEST_TIMEOUT: 90000 # xvfb is slow to start jobs: test: - strategy: - fail-fast: false - matrix: - include: - - platform: 'macos-latest' # for Arm based macs (M1 and above). - args: '--target aarch64-apple-darwin' - - platform: 'macos-latest' # for Intel based macs. - args: '--target x86_64-apple-darwin' - - platform: 'ubuntu-latest' - args: '' - - platform: 'windows-latest' - args: '' - timeout-minutes: 15 - runs-on: ${{ matrix.platform }} name: "Run UI E2E tests" + timeout-minutes: 15 + runs-on: ${{ inputs.os }} steps: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 @@ -58,10 +43,10 @@ jobs: toolchain: stable override: true - -# https://github.com/Swatinem/rust-cache/issues/169 - name: Setup Rust Cache uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2 + # https://github.com/Swatinem/rust-cache/issues/169 + if: input.os != windows-latest with: cache-all-crates: true cache-targets: true @@ -69,23 +54,22 @@ jobs: .build - name: Install Prerequisites - if: matrix.platform == 'ubuntu-latest' + if: input.os == 'ubuntu-latest' + shell: "bash" run: | . <(just prerequisites) - - name: Run UI E2E tests Linux - if: matrix.platform == 'ubuntu-latest' + - name: Linux - Run UI E2E tests + if: input.os == 'ubuntu-latest' + shell: "bash" run: xvfb-run -a just test-e2e - - name: Run UI E2E tests Windows + - name: Windows - Run UI E2E tests + if: input.os == 'windows-latest' shell: "bash" - if: matrix.platform == 'windows-latest' run: just test-e2e - - name: Run UI E2E tests MacOS - if: matrix.args == '--target aarch64-apple-darwin' - run: just test-e2e - - - name: Run UI E2E tests MacOS - if: matrix.args == '--target x86_64-apple-darwin' + - name: MacOS - Run UI E2E tests + if: input.os == 'macos-latest' + shell: "bash" run: just test-e2e diff --git a/.github/workflows/tests-linux.yaml b/.github/workflows/tests-linux.yaml new file mode 100644 index 0000000..4d586d5 --- /dev/null +++ b/.github/workflows/tests-linux.yaml @@ -0,0 +1,17 @@ +name: "Linux Tests" + +on: + workflow_call: + workflow_dispatch: + schedule: + - cron: "20 04 * * *" + push: + branches: + - master +jobs: + + linux-e2e: + name: "Run e2e tests" + uses: ./.github/workflows/main.yaml + with: + os: ubuntu-latest \ No newline at end of file diff --git a/.github/workflows/tests-macos.yaml b/.github/workflows/tests-macos.yaml new file mode 100644 index 0000000..4ec0609 --- /dev/null +++ b/.github/workflows/tests-macos.yaml @@ -0,0 +1,17 @@ +name: "macOS Tests" + +on: + workflow_call: + workflow_dispatch: + schedule: + - cron: "20 04 * * *" + push: + branches: + - master +jobs: + + macos-e2e: + name: "Run e2e tests" + uses: ./.github/workflows/main.yaml + with: + os: macos-latest \ No newline at end of file diff --git a/.github/workflows/tests-windows.yaml b/.github/workflows/tests-windows.yaml new file mode 100644 index 0000000..b8c8fcb --- /dev/null +++ b/.github/workflows/tests-windows.yaml @@ -0,0 +1,17 @@ +name: "Windows Tests" + +on: + workflow_call: + workflow_dispatch: + schedule: + - cron: "20 04 * * *" + push: + branches: + - master +jobs: + + windows-e2e: + name: "Run e2e tests" + uses: ./.github/workflows/main.yaml + with: + os: windows-latest \ No newline at end of file