chore: CI performance improvements

- run more jobs in parallel for `example` and `integration` tests
- use cachitx for unit tests
This commit is contained in:
DavHau 2022-08-24 13:14:07 +02:00
parent da45122814
commit aeaf598afd
3 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,7 @@ jobs:
name: nix-community name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix run .#tests-examples - run: JOBS=10 nix run .#tests-examples
tests-pure: tests-pure:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -54,7 +54,7 @@ jobs:
name: nix-community name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix run .#tests-integration - run: JOBS=10 nix run .#tests-integration
tests-unit-nix: tests-unit-nix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -66,6 +66,10 @@ jobs:
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: | extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v10
with:
name: nix-community
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix run .#tests-unit - run: nix run .#tests-unit

View File

@ -53,7 +53,8 @@ in
'' ''
export STATS_FILE=$(mktemp) export STATS_FILE=$(mktemp)
if [ -z ''${1+x} ]; then if [ -z ''${1+x} ]; then
parallel --halt now,fail=1 -j$(nproc) -a <(ls ${examples}) ${testScript} JOBS=''${JOBS:-$(nproc)}
parallel --halt now,fail=1 -j$JOBS -a <(ls ${examples}) ${testScript}
else else
arg1=$1 arg1=$1
shift shift

View File

@ -48,7 +48,8 @@ in
'' ''
export STATS_FILE=$(mktemp) export STATS_FILE=$(mktemp)
if [ -z ''${1+x} ]; then if [ -z ''${1+x} ]; then
parallel --halt now,fail=1 -j$(nproc) -a <(ls ${tests}) ${testScript} JOBS=''${JOBS:-$(nproc)}
parallel --halt now,fail=1 -j$JOBS -a <(ls ${tests}) ${testScript}
else else
arg1=$1 arg1=$1
shift shift