Skip to content

Commit

Permalink
Develop (#2)
Browse files Browse the repository at this point in the history
Added watcher and a lot of ci stuff
  • Loading branch information
danlapid authored Aug 27, 2022
1 parent 079aaf1 commit 46a4cbb
Show file tree
Hide file tree
Showing 35 changed files with 715 additions and 344 deletions.
4 changes: 0 additions & 4 deletions .devcontainer/.env

This file was deleted.

19 changes: 0 additions & 19 deletions .devcontainer/Dockerfile

This file was deleted.

36 changes: 0 additions & 36 deletions .devcontainer/devcontainer.json

This file was deleted.

55 changes: 0 additions & 55 deletions .devcontainer/docker-compose.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go text eol=lf
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on:
push:
paths: ["**.go", "go.mod", ".github/workflows/*"]

jobs:
build:
strategy:
fail-fast: false
matrix:
go:
- "1.19"
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --snapshot --rm-dist
24 changes: 0 additions & 24 deletions .github/workflows/go.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint
on:
push:
paths: ["**.go", "go.mod", ".github/workflows/*"]

jobs:
lint:
name: "lint"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- "1.19"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
version: latest

- name: Go vet
run: "go vet ./..."

- name: Staticcheck
uses: dominikh/staticcheck-action@master
with:
version: "2022.1"
install-go: false
cache-key: ${{ matrix.go }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
push:
tags:
- "v*"

name: Upload release assets after tagging
jobs:
build:
name: Create assets
strategy:
fail-fast: false
matrix:
os:
- macos-latest
go:
- "1.19"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
go:
- "1.19"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: test
run: |
go test -v -race ./...
coverage:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
go:
- "1.19"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Calc coverage
run: |
go test -v -covermode=count -coverprofile=coverage.out -coverpkg ./pkg/... ./...
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/gcov2lcov-action@master
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
Loading

0 comments on commit 46a4cbb

Please sign in to comment.