Files
cgrates/.github/workflows/build.yaml
ionutboangiu c987c3e72e Execute github actions workflows only on PRs for now
At the moment, the check-if-duplicate-action needs a bit more tinkering, since
it will skip testing other PRs, if the previous one was successful. Another thing
that might need a revision is to make the duplicate checking job be a bit more subtle
and not be visible where it shouldn't be.
2023-07-21 09:01:46 +02:00

69 lines
1.7 KiB
YAML

name: Build & Unit Tests
permissions: {}
on:
# push:
# branches: [v0.10]
pull_request:
branches: [v0.10]
jobs:
# check-if-duplicate-action:
# continue-on-error: true
# runs-on: ubuntu-latest
# outputs:
# should_skip: ${{ steps.skip_check.outputs.should_skip }}
# steps:
# - id: skip_check
# uses: fkirc/skip-duplicate-actions@v5
# with:
# concurrent_skipping: 'never'
# skip_after_successful_duplicate: 'true'
# paths_ignore: '["v0.10/docs/**"]'
# paths: '["v0.10/**.go", "v0.10/.github"]'
build:
# needs: check-if-duplicate-action
# if: needs.check-if-duplicate-action.outputs.should_skip != 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
go: ["stable"] # could be a good idea to consider oldstable as well
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Go Format
run: gofmt -s -w . && git diff --exit-code
- name: Go Vet
continue-on-error: true # option will soon be removed
run: go vet ./...
- name: Go Tidy
run: go mod tidy && git diff --exit-code
- name: Go Mod
run: go mod download
- name: Go Mod Verify
run: go mod verify
- name: Go Build
run: ./build.sh
- name: Go Test
run: go test -count=1 ./... # should probably also add -race flag in the future
- name: Go Benchmark
run: go test -run=- -bench=. -benchtime=1x ./...