From 43d0cc341a2bf5e439007eae9d7eb4de473df56a Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Thu, 31 Aug 2023 10:55:28 -0400 Subject: [PATCH] Clean up CI config, move license-check in Clean up CI config to match how we do it in other OF repos. Move license-check job from Prow to GH. Signed-off-by: Andy Goldstein --- .github/workflows/ci.yml | 80 ++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d5521..c7f9911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,81 +1,55 @@ name: CI on: + workflow_dispatch: + merge_group: push: - branches: [ main ] + branches: + - main pull_request: - branches: [ main ] jobs: - test: - name: Test runs-on: ubuntu-latest steps: - - - name: Set up Go 1.x - uses: actions/setup-go@v3 - with: - go-version: 1.19.x - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Cache go module cache - id: cache-go-mod - uses: actions/cache@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Get dependencies - run: go mod download - - - name: Test - run: make test - - - uses: shogo82148/actions-goveralls@v1 + go-version-file: "go.mod" + - run: make test + - uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - path-to-profile: cover.out + files: cover.out + functionalities: fixes lint: - name: Lint runs-on: ubuntu-latest steps: - - - name: Set up Go 1.x - uses: actions/setup-go@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: 1.19.x - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3 + go-version-file: "go.mod" + - uses: golangci/golangci-lint-action@v3 with: version: v1.49 args: --timeout 5m go-apidiff: - name: go-apidiff if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - - - name: Set up Go 1.x - uses: actions/setup-go@v3 + - uses: actions/checkout@v3 with: - go-version: ^1.19 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + fetch_depth: 0 + - uses: actions/setup-go@v4 with: - fetch-depth: 0 + go-version-file: "go.mod" + - uses: joelanford/go-apidiff@main - - name: Run go-apidiff - uses: joelanford/go-apidiff@main + license-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: make check-license