Bump github/codeql-action from 2.21.5 to 2.21.6 #179
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2022 Yahoo Inc. | |
# Licensed under the terms of the Apache License 2.0. Please see LICENSE file in project root for terms. | |
name: CI-Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: read-all | |
jobs: | |
unit-tests: | |
name: Run ${{matrix.go}} unit tests | |
permissions: | |
contents: read | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
go: [ '1.18.x', '1.19.x' ] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- name: checkout | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds | |
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
# In order: | |
# * Module download cache | |
# * Build cache (Linux) | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Setup go | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install required packages | |
run: sudo apt-get install -y libpam0g-dev | |
- name: Run Go vet | |
run: go vet -v ./... | |
- name: Run Go build | |
run: go build ./cmd/... | |
- name: Run Go tests | |
run: go test -covermode atomic -coverprofile coverage.txt ./... | |
- name: Upload Coverage Report | |
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 | |
with: | |
file: ./coverage.txt | |
- name: Run Go tests with `-race` | |
run: go test -v -race ./... | |