Skip to content

Commit

Permalink
ci: configure github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
osechet committed Aug 6, 2024
1 parent d32cc55 commit 376809b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 21 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:

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

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59

- name: Test
run: go test -v -race -coverprofile=coverage.out -covermode=atomic

- name: Code Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
19 changes: 19 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
run:
go: "1.20"
linters:
enable:
- stylecheck
linters-settings:
stylecheck:
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
checks: ["all", "-ST1000", "-ST1016"]
# https://staticcheck.io/docs/configuration/options/#dot_import_whitelist
# Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"]
dot-import-whitelist: []
# https://staticcheck.io/docs/configuration/options/#initialisms
# Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
# https://staticcheck.io/docs/configuration/options/#http_status_code_whitelist
# Default: ["200", "400", "404", "500"]
http-status-code-whitelist: []
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2017 Olivier Sechet.
Copyright (c) 2024 Olivier Sechet.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# timex - A Go time extension library

[![Build Status](https://www.travis-ci.org/osechet/timex.svg?branch=master)](https://www.travis-ci.org/osechet/timex)
[![Build Status](https://github.com/osechet/timex/actions/workflows/go.yml/badge.svg)](https://github.com/osechet/timex/actions)
[![codecov](https://codecov.io/gh/osechet/timex/branch/master/graph/badge.svg)](https://codecov.io/gh/osechet/timex)


## Install

```
```sh
go get github.com/osechet/timex
```

Expand All @@ -16,10 +15,9 @@ The purpose of the library is to provide several extensions to the standard Go t

## Example


### GPS

```
```go
// Display the GPS time of the current time, in microseconds
fmt.Println(int64(timex.GpsTime(time.Now()).Gps() / time.Microsecond))
```
Expand Down

0 comments on commit 376809b

Please sign in to comment.