1
0
mirror of https://github.com/getsops/sotp.git synced 2026-02-05 09:45:59 +01:00

Replace CircleCI with GitHub Action workflow

Linter has been deprecated, using `go vet` should generally be
sufficient.

xref: https://github.com/golang/lint

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
Hidde Beydals
2023-06-29 22:54:02 +02:00
parent e45eacc000
commit e396c375f3
3 changed files with 56 additions and 34 deletions

View File

@@ -1,31 +0,0 @@
version: 2
jobs:
test:
docker:
- image: circleci/golang:1.14
steps:
- checkout
- run: gpg --allow-secret-key-import sops_functional_tests_key.asc
- run: go test
- run: go run main.go test1
lint:
docker:
- image: circleci/golang:1.14
steps:
- checkout
- run: go get -u golang.org/x/lint/golint
- run: golint .
vet:
docker:
- image: circleci/golang:1.14
steps:
- checkout
- run: go vet .
workflows:
version: 2
all:
jobs:
- test
- lint
- vet

55
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
paths-ignore:
- README.md
- docs/**
jobs:
test:
name: Go ${{ matrix.go-version }} (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
go-version: [1.19.x, 1.20.x]
platform: [ubuntu-latest]
steps:
- name: Install Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Run mod tidy
run: go mod tidy
- name: Run vet
run: go vet ./...
- name: Run fmt
run: go fmt ./...
- name: Check if directory is clean
run: git diff --exit-code
- name: Import test key
run: gpg --import sops_functional_tests_key.asc
- name: Run tests
run: go test -v -race ./...
- name: Run main.go test1
run: go run main.go test1

View File

@@ -2,9 +2,7 @@
Small utility to store AWS TOTP secrets into Sops encrypted files and generate OTP on the command line.
[![CircleCI](https://circleci.com/gh/mozilla/sotp.svg?style=svg)](https://circleci.com/gh/mozilla/sotp)
usage:
Usage:
```
$ sotp test1