chore: update deprecated SliceHeader usage #19
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: [ 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@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Check out code | |
uses: actions/checkout@v3 | |
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@v3 | |
- name: Run linter | |
uses: golangci/golangci-lint-action@v6.0.1 # 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 |