Skip to content

Commit

Permalink
Clean up CI config, move license-check in (#119)
Browse files Browse the repository at this point in the history
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 <andy.goldstein@redhat.com>
  • Loading branch information
ncdc committed Sep 1, 2023
1 parent 6efbe3a commit 40a2f93
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 53 deletions.
80 changes: 27 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
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
go-version-file: "go.mod"
- run: make test
- uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
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
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
with:
go-version: ^1.19
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
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
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @operator-framework/operator-lib-maintainers

0 comments on commit 40a2f93

Please sign in to comment.