From 447120f1c4b9c27f7b91232c467180af62d4c060 Mon Sep 17 00:00:00 2001 From: Mike Landau Date: Tue, 31 Jan 2023 14:55:27 -0800 Subject: [PATCH 1/2] [CICD] Only run mac tests on main --- .github/workflows/cli-tests.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-tests.yaml b/.github/workflows/cli-tests.yaml index 2a8d636559c..0941b03109e 100644 --- a/.github/workflows/cli-tests.yaml +++ b/.github/workflows/cli-tests.yaml @@ -29,7 +29,7 @@ jobs: golangci-lint: strategy: matrix: - os: [ubuntu-latest, macos-12] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} timeout-minutes: 10 steps: @@ -59,7 +59,9 @@ jobs: test: strategy: matrix: - os: [ubuntu-latest, macos-12] + os: [ubuntu-latest, macos-latest] + exclude: + - os: ${{ github.ref == 'refs/heads/main' && 'dummy' || 'macos-latest' }} runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: From d53f9340adc33107ba7889f2ec860467b6d0a70f Mon Sep 17 00:00:00 2001 From: Mike Landau Date: Tue, 31 Jan 2023 16:13:07 -0800 Subject: [PATCH 2/2] Ensure mac tests are run for release and pre-release --- .github/workflows/cli-release.yml | 2 ++ .github/workflows/cli-tests.yaml | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 7c56aa1e8ec..edaacd4a0e7 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -27,6 +27,8 @@ permissions: jobs: tests: uses: ./.github/workflows/cli-tests.yaml + with: + run-mac-tests: true prerelease: runs-on: ubuntu-latest diff --git a/.github/workflows/cli-tests.yaml b/.github/workflows/cli-tests.yaml index 0941b03109e..ce58563501c 100644 --- a/.github/workflows/cli-tests.yaml +++ b/.github/workflows/cli-tests.yaml @@ -11,6 +11,9 @@ on: branches: - main workflow_call: + inputs: + run-mac-tests: + type: boolean workflow_dispatch: permissions: @@ -61,9 +64,11 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] exclude: - - os: ${{ github.ref == 'refs/heads/main' && 'dummy' || 'macos-latest' }} + # This expression basically says run mac tests if on main branch or + # if this job is triggered by another workflow with "with: run-mac-tests: true" + - os: ${{ (github.ref == 'refs/heads/main' || inputs.run-mac-tests) && 'dummy' || 'macos-latest' }} runs-on: ${{ matrix.os }} - timeout-minutes: 15 + timeout-minutes: ${{ (github.ref == 'refs/heads/main' || inputs.run-mac-tests) && '20' || '10' }} steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3.5.0