Bump the stable-updates group across 1 directory with 4 updates #565
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
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build Binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go ^1.20 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.20' | |
- name: Build | |
run: make build | |
lint: | |
name: Linting | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
pull-requests: write # for golangci/golangci-lint-action to fetch pull requests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.20' | |
check-latest: true | |
cache: true | |
- name: Lint Code Base | |
uses: github/super-linter/slim@v4 | |
env: | |
VALIDATE_ALL_CODEBASE: false | |
DEFAULT_BRANCH: master | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FILTER_REGEX_EXCLUDE: .*helm-chart.* | |
tests: | |
name: Unit & Integration Test | |
runs-on: ubuntu-latest | |
container: node:10.18-jessie | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: app | |
POSTGRES_PASSWORD: pass | |
POSTGRES_DB: app | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go ^1.20 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.20' | |
- name: Running unit tests | |
run: make test-unit | |
- name: Running integration tests | |
env: | |
TEST_DB_HOST: postgres | |
run: | | |
make test-integration | |
- name: Merge unit & integration tests code coverage | |
run: | | |
go install github.com/wadey/gocovmerge@latest | |
gocovmerge coverage_unit.out coverage_integration.out > coverage.out | |
- name: Publish artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage-${{ github.sha }}.out | |
path: coverage.out | |
code-analysis: | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download test coverage artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: coverage-${{ github.sha }}.out | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |