Skip to content

chore: updated dependencies #42

chore: updated dependencies

chore: updated dependencies #42

Workflow file for this run

name: ci
on:
pull_request:
branches:
- "**"
push:
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Load cached dependencies
id: cached-go-dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-${{ inputs.go_version }}-v1.0-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.cached-go-dependencies.outputs.cache-hit != 'true'
shell: bash
run: go get -v -t ./...
analyze:
needs: setup
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Load cached dependencies
id: cached-go-dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-${{ inputs.go_version }}-v1.0-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.cached-go-dependencies.outputs.cache-hit != 'true'
shell: bash
run: go get -v -t ./...
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
lint:
needs: setup
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Load cached dependencies
id: cached-go-dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-${{ inputs.go_version }}-v1.0-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.cached-go-dependencies.outputs.cache-hit != 'true'
shell: bash
run: go get -v -t ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
continue-on-error: true
with:
version: v1.53
skip-go-installation: true
skip-pkg-cache: true
skip-build-cache: true
test:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Load cached dependencies
id: cached-go-dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-${{ inputs.go_version }}-v1.0-${{ hashFiles('**/go.sum') }}
- name: Install dependencies
if: steps.cached-go-dependencies.outputs.cache-hit != 'true'
shell: bash
run: go get -v -t ./...
- name: Run Tests
run: go test -coverprofile=coverage.out ./...
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./coverage.out
sonarcloud:
needs: [test, lint, analyze]
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Coverage Report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}