diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f06de6d0..a1c9725b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,4 +38,4 @@ jobs: uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 \ No newline at end of file + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1c9a19b4..e7a8c619 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,13 +12,11 @@ on: - '*' jobs: - - build: - name: Build + docker: + name: Docker runs-on: ubuntu-latest steps: - - - name: Check out code into the Go module directory + - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1cff6bee..9ec1b5c0 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -11,10 +11,12 @@ on: pull_request: jobs: - lint: + linter: + name: Linter runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a87bb52b..301beb7f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,11 @@ on: - '*' jobs: - build: - name: Build + release: + name: Release runs-on: ubuntu-latest steps: - - name: Check out code into the Go module directory + - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 @@ -28,15 +28,13 @@ jobs: - name: Cache go module uses: actions/cache@v4 with: - path: ~/go/pkg/mod + path: | + ~/go/pkg/mod + ~/.cache/go-build key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Run test - run: | - go test ./... - - name: Build if: startsWith(github.ref, 'refs/tags/') run: make -j releases diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..05684f70 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test + +concurrency: + group: test-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - 'main' + pull_request: + +jobs: + build-test: + name: Build Test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + check-latest: true + go-version-file: 'go.mod' + + - name: Run test + run: | + go test ./...