Skip to content

Commit

Permalink
Update test and lint workflow files (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
samcoe committed May 9, 2022
1 parent 494f62a commit ff0ff65
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 66 deletions.
78 changes: 18 additions & 60 deletions .github/workflows/codeql-analysis.yml
@@ -1,70 +1,28 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

name: Code Scanning
on:
push:
branches: [ trunk ]
branches: [trunk]
pull_request:
# The branches below must be a subset of the branches above
branches: [ trunk ]
branches: [trunk]
schedule:
- cron: '41 10 * * 2'

- cron: '0 0 * * 0'
permissions:
actions: read
contents: read
security-events: write
jobs:
analyze:
name: Analyze
CodeQL-Build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# 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

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- name: Checkout repository
uses: actions/checkout@v3

#- run: |
# make bootstrap
# make release
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
34 changes: 31 additions & 3 deletions .github/workflows/lint.yml
@@ -1,6 +1,29 @@
name: Lint
on: [push, pull_request]
permissions:
contents: read
jobs:
go-mod:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.16]
runs-on: ${{ matrix.os }}

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

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

- name: Check go mod
run: |
go mod tidy
git diff --exit-code go.mod
lint:
strategy:
matrix:
Expand All @@ -9,10 +32,15 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

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

- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3.1.0
with:
version: latest
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
@@ -1,5 +1,7 @@
name: Test
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
strategy:
Expand All @@ -11,12 +13,12 @@ jobs:

steps:
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

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

- name: Run tests
run: go test -v ./...

0 comments on commit ff0ff65

Please sign in to comment.