From 2ea9d044ef1d166c9b5d3968d7b7f1a24b8a02f5 Mon Sep 17 00:00:00 2001 From: Javier Molina Reyes Date: Fri, 2 Aug 2024 17:48:14 +0200 Subject: [PATCH] fix: enable cache for Set up Go action (#3933) * enable cache for Set up Go action * different order * try again * try again * try again * try again * try again * fix order * run matrix * fix yaml * matrix for integration tests * fix targets * beautify * remove dup --- .github/workflows/ci.yml | 169 +++++++++++---------------------------- 1 file changed, 47 insertions(+), 122 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd4b6ac0e36..7692cfbbca7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,21 +17,18 @@ concurrency: cancel-in-progress: true jobs: - lint: name: Lint runs-on: ubuntu-latest steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' - - name: Check out code uses: actions/checkout@v4 with: - fetch-depth: '0' - + fetch-depth: "0" + - name: Set up Go 1.22 + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" - name: check-fmt run: make check-fmt @@ -41,137 +38,65 @@ jobs: - name: lint run: make lint base=origin/${{github.base_ref}} - unit-tests-pkg: - name: Test packages - pkg + unit-tests: + name: Run Unit Tests runs-on: ubuntu-latest - steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 - - - name: Test - run: make test-with-cover-pkg - - unit-tests-tempodb: - name: Test packages - tempodb - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' + strategy: + matrix: + test-target: + [ + test-with-cover-pkg, + test-with-cover-tempodb, + test-with-cover-tempodb-wal, + test-with-cover-others, + ] - - name: Check out code - uses: actions/checkout@v4 - - - name: Test - run: make test-with-cover-tempodb - - unit-tests-tempodb-wal: - name: Test packages - tempodb/wal - runs-on: ubuntu-latest steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' - - name: Check out code uses: actions/checkout@v4 - - name: Test - run: make test-with-cover-tempodb-wal - - unit-tests-others: - name: Test packages - others - runs-on: ubuntu-latest - steps: - name: Set up Go 1.22 uses: actions/setup-go@v5 with: - go-version: '>=1.22.4' + go-version-file: "go.mod" - - name: Check out code - uses: actions/checkout@v4 - - - name: Test - run: make test-with-cover-others + - name: Run Tests + run: make ${{ matrix.test-target }} integration-tests: - name: Test integration e2e suite + name: Run integration tests runs-on: ubuntu-latest - steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 - - - name: Test - run: make test-e2e + strategy: + matrix: + test-target: + [ + test-e2e, + test-integration-poller, + test-e2e-deployments, + test-e2e-serverless, + ] - integration-tests-poller: - name: Test integration e2e suite - poller - runs-on: ubuntu-latest steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' - - name: Check out code uses: actions/checkout@v4 - - - name: Poller - run: make test-integration-poller - - integration-tests-deployment-modes: - name: Test integration e2e suite - deployment modes - runs-on: ubuntu-latest - steps: - name: Set up Go 1.22 uses: actions/setup-go@v5 with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 + go-version-file: "go.mod" + - name: Run Tests + run: make ${{ matrix.test-target }} - - name: Deployment modes - run: make test-e2e-deployments - - integration-tests-serverless: - name: Test integration e2e suite - serverless + build: + name: Build runs-on: ubuntu-latest steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: '>=1.22.4' - - name: Check out code uses: actions/checkout@v4 - - name: Test - run: make test-e2e-serverless - - build: - name: Build - runs-on: ubuntu-latest - steps: - name: Set up Go 1.22 uses: actions/setup-go@v5 with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 + go-version-file: "go.mod" - name: Build Tempo run: make tempo @@ -189,13 +114,13 @@ jobs: name: Benchmark runs-on: ubuntu-latest steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go 1.22 uses: actions/setup-go@v5 with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 + go-version-file: "go.mod" - name: Bench run: make test-bench @@ -204,13 +129,13 @@ jobs: name: Vendor check runs-on: ubuntu-latest steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go 1.22 uses: actions/setup-go@v5 with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 + go-version-file: "go.mod" - name: Install Protoc uses: arduino/setup-protoc@v3 @@ -224,13 +149,13 @@ jobs: name: Check jsonnet & tempo-mixin runs-on: ubuntu-latest steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go 1.22 uses: actions/setup-go@v5 with: - go-version: '>=1.22.4' - - - name: Check out code - uses: actions/checkout@v4 + go-version-file: "go.mod" - name: Check jsonnet run: make jsonnet-check