| 1 |
name: CI |
| 2 |
|
| 3 |
on: |
| 4 |
# Pushes and pulls to all branches |
| 5 |
push: |
| 6 |
pull_request: |
| 7 |
|
| 8 |
# Run on the first day of every month |
| 9 |
schedule: |
| 10 |
- cron: "0 0 1 * *" |
| 11 |
|
| 12 |
# Allows you to run this workflow manually from the Actions tab |
| 13 |
workflow_dispatch: |
| 14 |
|
| 15 |
jobs: |
| 16 |
# Build and test everything |
| 17 |
build: |
| 18 |
runs-on: ubuntu-latest |
| 19 |
steps: |
| 20 |
# Checkout the code |
| 21 |
- name: Checkout Code |
| 22 |
uses: actions/checkout@v4 |
| 23 |
|
| 24 |
# Set up the GoLang environment |
| 25 |
- name: Set up Go |
| 26 |
uses: actions/setup-go@v5 |
| 27 |
with: |
| 28 |
go-version: 1.17 |
| 29 |
|
| 30 |
# Download all the tools used in the steps that follow |
| 31 |
- name: Set up Tools |
| 32 |
run: | |
| 33 |
go install github.com/fzipp/gocyclo/cmd/[email protected] |
| 34 |
go install github.com/mattn/[email protected] |
| 35 |
|
| 36 |
# Run all the unit-tests |
| 37 |
- name: Test |
| 38 |
run: | |
| 39 |
make test |
| 40 |
|
| 41 |
# Run some tests to ensure no race conditions exist |
| 42 |
- name: Test for Race Conditions |
| 43 |
run: make test-race |
| 44 |
|
| 45 |
# Run the benchmarks to manually ensure no performance degradation |
| 46 |
- name: Benchmark |
| 47 |
run: make bench |
| 48 |
|
| 49 |
# Upload all the unit-test coverage reports to Coveralls |
| 50 |
- name: Upload Coverage Report |
| 51 |
env: |
| 52 |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 |
run: goveralls -service=github -coverprofile=.coverprofile |
| 54 |
|