Skip to content

Merge pull request #6 from rustatian/dependabot/go_modules/golang.org… #35

Merge pull request #6 from rustatian/dependabot/go_modules/golang.org…

Merge pull request #6 from rustatian/dependabot/go_modules/golang.org… #35

Workflow file for this run

name: CI
on: [ push, pull_request ]
jobs:
build:
name: Build (Go ${{ matrix.go }}, OS ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go: [ stable ]
os: [ ubuntu-latest ]
env:
GO111MODULE: on
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Show versions
run: go version
- name: Install Go dependencies
run: go mod download
- name: Run golang tests
run: |
go test ./semaphore -race -v -coverprofile=semaphore.txt -covermode=atomic
go test ./shm -race -v -coverprofile=shm.txt -covermode=atomic
- name: Run code coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
if [[ "$CODECOV_TOKEN" != "" ]]; then
curl https://codecov.io/bash -o codecov-bash
chmod +x codecov-bash
./codecov-bash -f semaphore.txt
./codecov-bash -f shm.txt
fi
golangci-lint:
name: Golang-CI (lint)
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run linter
uses: golangci/golangci-lint-action@v6.1.0 # Action page: <https://github.com/golangci/golangci-lint-action>
with:
version: v1.59 # without patch version
only-new-issues: false # show only new issues if it's a pull request
args: --timeout=10m