Skip to content

Commit

Permalink
ci: generic improvements to CI
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
  • Loading branch information
sagikazarmark authored and aslafy-z committed May 22, 2023
1 parent 4a7d7df commit 0bdba5a
Showing 1 changed file with 52 additions and 19 deletions.
71 changes: 52 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,78 @@
name: CI

on:
pull_request:
push:
branches:
- master
- release-3.17
pull_request:

jobs:
build:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: '1.19'

- name: Checkout code
uses: actions/checkout@v3

- name: Download license information for dependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make license-cache
- name: Test
run: make test

- name: Check licenses
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make license-check
- name: Check diff
run: make check-diff

lint:
name: Lint
runs-on: ubuntu-latest

- name: Check Diff
run: |
make check-diff
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Checkout code
uses: actions/checkout@v3

- name: Lint
run: make lint
env:
LINTER_FLAGS: '--timeout 5m'
run: |
make lint

- name: Run tests
run: |
make test
license-check:
name: License check
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Checkout code
uses: actions/checkout@v3

- name: Cache licenses
uses: actions/cache@v3
with:
key: licensei-v2-${{ hashFiles('go.sum') }}
path: |
.licensei.cache
restore-keys: |
licensei-v2
- name: Download license information for dependencies
env:
GITHUB_TOKEN: ${{ github.token }}
run: make license-cache

- name: Check licenses
env:
GITHUB_TOKEN: ${{ github.token }}
run: make license-check

0 comments on commit 0bdba5a

Please sign in to comment.