Skip to content

Commit

Permalink
created go.mod and added github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Fank committed Aug 15, 2024
1 parent e5bd549 commit b8fb074
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "Fank"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "Fank"
93 changes: 93 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Go

on:
push:
branches:
- main
- master
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Set up Golang build cache
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-golang-golangci-lint-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest

test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Set up Golang build cache
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-golang-test-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Download go modules
run: go mod download

- name: Test
uses: robherley/go-test-action@v0
with:
testArguments: ./...

license-check:
runs-on: ubuntu-latest
name: License Check
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest
shell: bash

- name: Check licenses
run: >
go-licenses check ./...
--ignore ${{ github.repository }}
shell: bash

- name: Get licenses list
run: >
go-licenses csv ./...
--ignore ${{ github.repository }}
shell: bash
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/enthus-golang/desy

go 1.22.6

0 comments on commit b8fb074

Please sign in to comment.