Skip to content

ci: validate against multiple versions #173

ci: validate against multiple versions

ci: validate against multiple versions #173

Workflow file for this run

name: CI
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.19, 1.20, 1.21]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build Confidence
run: cd pkg/confidence && go build -v .
- name: Build Provider
run: cd pkg/provider && go build -v .
- name: Test Confidence
run: cd pkg/confidence && go test -v
- name: Test Provider
run: cd pkg/provider && go test -v
- name: Run gofmt
run: |
modules=("pkg/confidence" "pkg/provider" "demo" "demo-open-feature")
fmt_issues=""
for module in "${modules[@]}"; do
fmt_output=$(gofmt -l "$module")
if [ -n "$fmt_output" ]; then
fmt_issues+="$fmt_output"$'\n'
fi
done
if [ -n "$fmt_issues" ]; then
echo "The following files are not properly formatted:"
echo "$fmt_issues"
echo "Please run 'gofmt -w .' in the respective module directories to format your code."
exit 1
fi