Skip to content

Commit

Permalink
Update CI (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Feb 23, 2023
1 parent a17cb69 commit 3f2ea32
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [main]
schedule:
- cron: '0 10 * * 1'
- cron: '0 10 * * 1' # run "At 10:00 on Monday"
workflow_call:

jobs:
Expand All @@ -19,11 +19,11 @@ jobs:
strategy:
fail-fast: true
matrix:
go: ['1.19.x', '1.20.x']
go: ['stable', 'oldstable']

steps:
- name: Install Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # latest
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
check-latest: true
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./...

- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # latest
uses: codecov/codecov-action@v3
continue-on-error: true
with:
token: ${{secrets.CODECOV_TOKEN}}
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ permissions:
security-events: write

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 10 * * 1'
- cron: '0 10 * * 1' # run "At 10:00 on Monday"
workflow_call:

jobs:
Expand All @@ -19,23 +15,22 @@ jobs:

steps:
- name: Install Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # latest
uses: actions/setup-go@v3
with:
go-version: "stable"
check-latest: true

- name: Checkout code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # latest
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # latest
uses: github/codeql-action/init@v2
with:
languages: go
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main


- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # latest
uses: github/codeql-action/analyze@v2
14 changes: 5 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ name: lint
permissions: read-all

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
inputs:
go:
description: Go version
default: 1.19
required: false
type: string

jobs:
run:
Expand All @@ -18,8 +16,6 @@ jobs:
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
go: ['1.19.x', '1.20.x']

steps:
- name: Checkout code
Expand All @@ -28,7 +24,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # latest
with:
go-version: ${{ inputs.go }}
go-version: 'stable'
check-latest: true

- name: Lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # latest
uses: actions/checkout@v3

- name: Checkout with tags
run: git fetch --prune --unshallow --tags
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: true
matrix:
go: ['1.19.x', '1.20.x']
go: ['stable', 'oldstable']

steps:
- name: Install Go
Expand All @@ -21,13 +21,13 @@ jobs:
check-latest: true

- name: Checkout code
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # latest
uses: actions/checkout@v3

- name: Run tests
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./...

- name: Upload Coverage
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # latest
uses: codecov/codecov-action@v3
continue-on-error: true
with:
token: ${{secrets.CODECOV_TOKEN}}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/vuln.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [main]
schedule:
- cron: '0 10 * * 1'
- cron: '0 10 * * 1' # run "At 10:00 on Monday"
workflow_call:

jobs:
Expand All @@ -18,14 +18,12 @@ jobs:
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
go: ['1.20.x']

steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
go-version: 'stable'
check-latest: true

- name: Checkout
Expand Down

0 comments on commit 3f2ea32

Please sign in to comment.