From 10c22c0c94c8b5feb10b5d146ff457224a1c0962 Mon Sep 17 00:00:00 2001 From: Aki Kanellis Date: Thu, 4 Apr 2024 17:27:26 +0100 Subject: [PATCH] build: add benchmark workflow --- .github/workflows/benchmark.yml | 95 +++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 000000000..2d925b289 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,95 @@ +--- +name: Benchmark + +"on": + workflow_dispatch: + +jobs: + test-parallel-false: + name: "Test - Parallel: false, Cores: 1" + runs-on: ubuntu-latest + strategy: + matrix: + cores: [1, 2, 3, 4] + + steps: + - name: Free disk space + uses: jlumbroso/free-disk-space@v1.3.1 + + - name: Checkout + # yamllint disable-line rule:line-length + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup just + # yamllint disable-line rule:line-length + uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0 + with: + # renovate: datasource=crate depName=just + just-version: 1.25.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Python + # yamllint disable-line rule:line-length + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 + with: + # renovate: datasource=docker depName=python versioning=docker + python-version: 3.12.2 + cache: pip + + - name: Update apt + run: sudo apt update + + - name: Install test dependencies + run: sudo apt install vagrant virtualbox + + - name: Install dependencies + run: just install-dependencies + + - name: Run + run: MOLECULE_CPUS=${{ matrix.cores }} just test + + test-parallel-true: + name: "Test - Parallel: true" + runs-on: ubuntu-latest + strategy: + matrix: + instance: [workstation-pop-os, server-nas, server-pi] + cores: [1, 2, 3, 4] + + steps: + - name: Free disk space + uses: jlumbroso/free-disk-space@v1.3.1 + + - name: Checkout + # yamllint disable-line rule:line-length + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup just + # yamllint disable-line rule:line-length + uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0 + with: + # renovate: datasource=crate depName=just + just-version: 1.25.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Python + # yamllint disable-line rule:line-length + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 + with: + # renovate: datasource=docker depName=python versioning=docker + python-version: 3.12.2 + cache: pip + + - name: Update apt + run: sudo apt update + + - name: Install test dependencies + run: sudo apt install vagrant virtualbox + + - name: Install dependencies + run: just install-dependencies + + - name: Run + run: MOLECULE_CPUS=${{ matrix.cores }} just test --platform-name=${{ matrix.instance }}