Skip to content

Commit

Permalink
Use github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jspc committed Dec 31, 2023
1 parent dabc5d8 commit 4b19f7e
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches:
- '*'
tags:
- '*'

permissions: read-all

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v2
with:
go-version: '>=1.21.0'

- name: Build
run: |
make
- name: Test
run: |
go test -covermode=count -coverprofile=coverage.out -v ./...
- name: Convert coverage to lcov
uses: jandelgado/[email protected]

- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov

- name: gosec
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec ./...
- name: golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint run --skip-files='.*_test.go'
- name: Archive stuff
uses: actions/upload-artifact@v3
with:
name: build-artefacts
path: |
littleauth
build-and-push:
needs: test
permissions:
contents: write

runs-on: ubuntu-latest
if: contains(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3

- name: Download artefacts
uses: actions/download-artifact@v3
with:
name: build-artefacts

- name: Generate SBOM
uses: CycloneDX/gh-gomod-generate-sbom@v1
with:
version: v1
args: mod -licenses -json -output bom.json

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
littleauth
bom.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4b19f7e

Please sign in to comment.