Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nikandfor committed Nov 11, 2023
1 parent ea1ab48 commit 5a722be
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 18 deletions.
41 changes: 24 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,60 @@
version: 2
jobs:
go1.20: &base
go1.21: &base
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21
steps:
- run: go version
- checkout
- run: go test -tags nikandfor_loc_unsafe -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- run: bash <(curl -s https://codecov.io/bash)
- run: go test -tags nikandfor_loc_unsafe -race -v ./...

go1.20:
<<: *base
docker:
- image: cimg/go:1.20

go1.19: &base_next
go1.19:
<<: *base
docker:
- image: cimg/go:1.19
steps:
- run: go version
- checkout
- run: go test -tags nikandfor_loc_unsafe -race -v ./...

go1.18:
<<: *base_next
<<: *base
docker:
- image: cimg/go:1.18

go1.17:
<<: *base_next
<<: *base
docker:
- image: cimg/go:1.17

go1.16:
<<: *base_next
<<: *base
docker:
- image: circleci/golang:1.16
working_directory: /go/wd

go1.15:
<<: *base_next
<<: *base
docker:
- image: circleci/golang:1.15

go1.14:
<<: *base_next
<<: *base
docker:
- image: circleci/golang:1.14

go1.20_safe: &base_safe
go1.21_safe: &base_safe
<<: *base
steps:
- run: go version
- checkout
- run: go test -race -cover -v ./...
- run: go test -race -v ./...

go1.20_safe:
<<: *base_safe
docker:
- image: cimg/go:1.20

go1.19_safe:
<<: *base_safe
Expand All @@ -65,13 +70,15 @@ workflows:
version: 2
build:
jobs:
- go1.21_safe
- go1.20_safe
- go1.19_safe
- go1.18_safe
- go1.21
- go1.20
- go1.19
- go1.18
- go1.17
- go1.16
#- go1.16 test passes in official docker image (arm64), but not in circleci
- go1.15
- go1.14
31 changes: 31 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"

- name: Build
run: go build -v ./...

- name: Test
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint
on:
push:
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Documentation](https://pkg.go.dev/badge/github.com/nikandfor/loc)](https://pkg.go.dev/github.com/nikandfor/loc?tab=doc)
[![Build Status](https://travis-ci.com/nikandfor/loc.svg?branch=master)](https://travis-ci.com/nikandfor/loc)
[![Go workflow](https://github.com/nikandfor/json/actions/workflows/go.yml/badge.svg)](https://github.com/nikandfor/json/actions/workflows/go.yml)
[![CircleCI](https://circleci.com/gh/nikandfor/loc.svg?style=svg)](https://circleci.com/gh/nikandfor/loc)
[![codecov](https://codecov.io/gh/nikandfor/loc/tags/latest/graph/badge.svg)](https://codecov.io/gh/nikandfor/loc)
[![GolangCI](https://golangci.com/badges/github.com/nikandfor/loc.svg)](https://golangci.com/r/github.com/nikandfor/loc)
Expand Down

0 comments on commit 5a722be

Please sign in to comment.