Skip to content

Commit

Permalink
build: separate tests to different instances
Browse files Browse the repository at this point in the history
When we are allocating `cpus`, we need to ensure they roughly match the
core count used by the CI, otherwise there is a risk of GitHub shutting
the runner down due to overloading.
  • Loading branch information
akikanellis committed Dec 23, 2023
1 parent 150be4a commit ef701a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
name: Test
runs-on: macos-12
continue-on-error: ${{ inputs.continue-on-error }}
strategy:
matrix:
platform-name:
- workstation-pop-os
- server-nas
- server-pi

steps:
- name: Checkout
Expand Down Expand Up @@ -58,4 +64,4 @@ jobs:
restore-keys: ${{ runner.os }}-vagrant-

- name: Test
run: just test
run: just test --platform-name ${{ matrix.platform-name }}
8 changes: 5 additions & 3 deletions ansible/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ driver:
platforms:
- name: workstation-pop-os
groups: [workstations]
# `cpus` need to roughly match the core count used by the CI. Currently, we
# are using a 3-core macos-12 instance in '.github/workflows/test.yml',
# therefore we are using 2x 2-core instances with vagrant.
# `cpus` need to roughly match the core count used by the CI, otherwise
# there is a risk of GitHub shutting the runner down due to overloading.
# Currently, we are using a 3-core macos-12 instance in
# '.github/workflows/test.yml' which runs a single vagrant instance per
# matrix test, therefore we are using 2 cores per instance with vagrant.
# See:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
cpus: 2
Expand Down

0 comments on commit ef701a6

Please sign in to comment.