Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
henvic committed Nov 14, 2023
1 parent 8ccaa9c commit 10e5c53
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@ name: Code Scanning

on:
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: "17 0 * * 0"
- cron: '32 13 * * 4'

jobs:
CodeQL-Build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
21 changes: 7 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ name: Tests

on:
push:
paths:
- "**.go"
- go.mod
- go.sum
branches: [ "main" ]
pull_request:
paths:
- "**.go"
- go.mod
- go.sum
types: [opened, synchronize, reopened, ready_for_review]
# The branches below must be a subset of the branches above
branches: [ "main" ]

jobs:
test:
Expand All @@ -22,16 +18,13 @@ jobs:
name: Test
steps:

- name: Set up Go ${{ matrix.node }}
uses: actions/setup-go@v2
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Check out code
uses: actions/checkout@v2

- name: Download dependencies
run: go mod download
uses: actions/checkout@v4

- name: Test
# TODO(henvic): Skip generating code coverage when not sending it to Coveralls to speed up testing.
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ name: Lint

on:
push:
paths:
- "**.go"
- go.mod
- go.sum
branches: [ "main" ]
pull_request:
paths:
- "**.go"
- go.mod
- go.sum
types: [opened, synchronize, reopened, ready_for_review]
# The branches below must be a subset of the branches above
branches: [ "main" ]

jobs:

Expand All @@ -20,18 +16,18 @@ jobs:
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: "1.21.x"

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Verify dependencies
run: |
go mod verify
go mod download
- name: Installing static code analysis tools
run: ./scripts/ci-lint-install.sh

Expand Down

0 comments on commit 10e5c53

Please sign in to comment.