Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: 2 GitHub workflows #27

Merged
merged 4 commits into from
Mar 6, 2024
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/lint_pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow is used to verify if PR titles matches conventional commits strategy

name: Lint PR Title
run-name: "Lint PR - (#${{ github.event.number }}) ${{ github.event.pull_request.title }}"

permissions:
pull-requests: read

on:
pull_request_target:
types:
- opened
- edited
- ready_for_review

jobs:
lint:
name: Validate PR title matches conventional commits
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will build and test a golang project

name: PR CI
run-name: "CI pipeline for PR - (#${{ github.event.number }}) ${{ github.event.pull_request.title }}"

on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
ci:
name: Run CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Download Go dependencies
run: go get ./... && go mod tidy

- name: Check if all dependencies were commited
shell: bash
run: |
if [ "$(git status --porcelain)" ]; then
git status
exit 1
else
exit 0
fi

- name: Build codegen
run: go build -v ./...

- name: Test codegen
run: go test -v ./...
Loading