Skip to content

test

test #6

Workflow file for this run

name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: foreman
MYSQL_USER: foreman
MYSQL_PASSWORD: foreman
postgres:
image: postgres:9.6.2-alpine
env:
POSTGRES_DB: foreman
POSTGRES_USER: foreman
POSTGRES_PASSWORD: foreman
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.22.5
- name: Install Dependencies
run: |
make mod-download
make tools
- name: Lint
run: golangci-lint run -v
- name: Check dependencies for vulnerabilities
run: make check-mods || true
- name: Run tests
env:
MYSQL_CONNECTION: foreman:foreman@tcp(127.0.0.1:3306)/foreman?charset=utf8&parseTime=True
PG_CONNECTION: postgres://foreman:[email protected]:5432/foreman?sslmode=disable
run: |
make unit-test
make integration-test
- name: Upload reports to codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Store test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: /tmp/test-reports