Skip to content

Commit

Permalink
fix: updated ci
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpeterswa committed Mar 1, 2023
1 parent 431d9f9 commit ba6c81e
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/main.yml → .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,77 @@
---
on: [push, pull_request] # yamllint disable-line rule:truthy
on: [pull_request] # yamllint disable-line rule:truthy
name: main
jobs:

commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v1

- uses: actions/setup-node@v3
with:
node-version: 14
node-version: lts/*
- run: npm install --save-dev @commitlint/{config-conventional,cli}
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }}

golangci-lint:
strategy:
matrix:
go-version: [1.18.x]
go-version: [1.20.x]
os: [ubuntu-latest, macos-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.46
version: v1.51.1

yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: yaml-lint
uses: ibiqlik/action-yamllint@v3

hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile

test:
strategy:
matrix:
go-version: [1.18.x]
go-version: [1.20.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:

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

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Test
run: go test ./...
29 changes: 29 additions & 0 deletions .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Release Version

on: # yamllint disable-line rule:truthy
push:
branches:
- main

jobs:
release:
name: 'Release to GitHub'
runs-on: ubuntu-latest
steps:

- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install Semantic Release Plugins
run: npm install --save-dev @semantic-release/changelog @semantic-release/git conventional-changelog-conventionalcommits # yamllint disable-line rule:line-length

- name: Release Version
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
run: npx semantic-release
10 changes: 10 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
branches:
- master
- main
plugins:
- - "@semantic-release/commit-analyzer"
- preset: conventionalcommits
- - "@semantic-release/release-notes-generator"
- preset: conventionalcommits
- - "@semantic-release/github"

0 comments on commit ba6c81e

Please sign in to comment.