Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: lint

on: pull_request

env:
GO111MODULE: on

permissions:
contents: read

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.x
cache-dependency-path: "**/go.sum"
- run: make lint
51 changes: 51 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: pr

on: pull_request

env:
GO111MODULE: on

permissions:
contents: read

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
defaults:
run:
shell: bash
strategy:
matrix:
go-version: [1.x, 1.21.x]
platform: [ubuntu-latest]
include:
- go-version: 1.x
platform: ubuntu-latest
update-coverage: true
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4

- id: cache-paths
run: |
echo "go-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT

- name: Cache go modules
uses: actions/cache@v4
with:
path: |
${{ steps.cache-paths.outputs.go-cache }}
${{ steps.cache-paths.outputs.go-mod-cache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Build
run: make build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
# Dependency directories (remove the comment below to include it)
vendor/
coverage.txt
go-github-mock
go-github-mock
target/
Empty file added .golangci.yml
Empty file.
2 changes: 1 addition & 1 deletion go.defs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HOST := github.com
OWNER := migueleliasweb

init:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2

lint: init
$(GOPATH)/bin/golangci-lint run ./...
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"

Expand Down Expand Up @@ -74,7 +73,7 @@ func main() {
"paths",
)

ioutil.WriteFile(
os.WriteFile(
gen.OUTPUT_FILEPATH,
buf.Bytes(),
0755,
Expand Down