Updating CI for multiple platforms and remove linting from Makefile #19
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
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
check-modules: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Go(lang) | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21.x | |
- name: Check module dependencies | |
run: | | |
go version | |
test -z "$(go mod tidy && git status go.* --porcelain)" | |
go mod verify | |
run-unit-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [1.21.x] | |
platform: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Go(lang) ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run unit tests | |
run: | | |
which go | |
go version | |
go test -race ./... | |
check-compliance: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go(lang) | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21.x | |
- name: Build server binary | |
run: | | |
go version | |
make build-only | |
- name: Install k6 | |
run: | | |
curl https://github.com/grafana/k6/releases/download/v0.48.0/k6-v0.48.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1 | |
- name: k6 Compliance | |
run: | | |
echo "DatabaseURI: "${GITHUB_WORKSPACE}/gorm.db"" > config.yaml | |
bin/weesvc migrate; bin/weesvc serve & | |
./k6 run -e PORT=9092 https://raw.githubusercontent.com/weesvc/workbench/main/scripts/api-compliance.js |