Skip to content

Commit

Permalink
ci: split tests per os for badges
Browse files Browse the repository at this point in the history
  • Loading branch information
bukowa committed Jun 29, 2024
1 parent c51e782 commit 1527290
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 40 deletions.
64 changes: 24 additions & 40 deletions .github/workflows/tests-e2e-js.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -58,34 +43,33 @@ 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
cache-directories: |
.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
17 changes: 17 additions & 0 deletions .github/workflows/tests-linux.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/workflows/tests-macos.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/workflows/tests-windows.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1527290

Please sign in to comment.