Skip to content

Commit

Permalink
Replace Travis CI with GitHub Actions and some changes in CI (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
spyzhov authored Dec 25, 2022
1 parent e0be6f7 commit 83228e9
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 70 deletions.
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# These are supported funding model platforms
issuehunt: spyzhov/ajson
custom: ['https://www.paypal.me/spyzhov']
custom: ['https://paypal.me/StepanPyzhov']

#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
Expand Down
56 changes: 45 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: golangci-lint
name: Build

on:
push:
tags:
Expand All @@ -8,7 +9,9 @@ on:
pull_request:
branches:
- master

jobs:

golangci:
name: lint
runs-on: ubuntu-latest
Expand All @@ -17,15 +20,46 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2.5.2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.42.1

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

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

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
test:
strategy:
matrix:
go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x', '1.17.x', '1.18.x', '1.19.x' ]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: go test -json -race ./... > TestResults-${{ matrix.os }}-${{ matrix.go-version }}.json
- name: Upload Go test results
uses: actions/upload-artifact@v3
with:
name: Go-results-${{ matrix.os }}-${{ matrix.go-version }}
path: TestResults-${{ matrix.os }}-${{ matrix.go-version }}.json

codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go 1.19.x on ubuntu-latest
uses: actions/setup-go@v3
with:
go-version: '1.19.x'
- name: Setup Dependencies
run: |
go get golang.org/x/tools/cmd/cover
go get -t -v ./...
- name: Run Tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: unittests
fail_ci_if_error: true
verbose: true
7 changes: 3 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
linters:
disable-all: true
enable:
- gofmt
# - gofmt # removed due to https://github.com/golangci/golangci-lint/issues/3229
- govet
- errcheck
- staticcheck
- unused
- gosimple
- structcheck
- varcheck
- ineffassign
- deadcode
- typecheck
- gosec
- unused
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Abstract JSON

[![Build Status](https://travis-ci.com/spyzhov/ajson.svg?branch=master)](https://travis-ci.com/spyzhov/ajson)
[![Build](https://github.com/spyzhov/ajson/actions/workflows/main.yml/badge.svg)](https://github.com/spyzhov/ajson/actions/workflows/main.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/spyzhov/ajson)](https://goreportcard.com/report/github.com/spyzhov/ajson)
[![GoDoc](https://godoc.org/github.com/spyzhov/ajson?status.svg)](https://godoc.org/github.com/spyzhov/ajson)
[![Coverage Status](https://coveralls.io/repos/github/spyzhov/ajson/badge.svg?branch=master)](https://coveralls.io/github/spyzhov/ajson?branch=master)
[![codecov](https://codecov.io/gh/spyzhov/ajson/branch/master/graph/badge.svg)](https://codecov.io/gh/spyzhov/ajson)
[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go#json)

Abstract [JSON](https://www.json.org/) is a small golang package provides a parser for JSON with support of JSONPath, in case when you are not sure in its structure.
Expand Down
6 changes: 2 additions & 4 deletions decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import (
. "github.com/spyzhov/ajson/internal"
)

/*
The action codes.
Copy from `internal/state.go:144`
*/
// List of action codes.
// Copy from `internal/state.go:144`
const (
cl States = -2 /* colon */
cm States = -3 /* comma */
Expand Down
6 changes: 2 additions & 4 deletions internal/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var QuoteAsciiClasses = [128]Classes{
}

/*
The state codes.
The state codes.
*/
const (
GO States = iota /* start */
Expand Down Expand Up @@ -139,9 +139,7 @@ const (
N3 /* null */
)

/*
The action codes
*/
// List of action codes
const (
cl States = -2 /* colon */
cm States = -3 /* comma */
Expand Down

0 comments on commit 83228e9

Please sign in to comment.