Skip to content

Commit

Permalink
Refactor: Separate master and PR workflows (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
emranbm authored Dec 19, 2022
1 parent 586db3d commit d52a9ee
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/main.yml → .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
name: Main Workflow
name: Master Workflow
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-20.04
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Pull Request Workflow
on:
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.19.2'
- name: Test
run: go test ./... -v -coverprofile=coverage.txt -covermode count
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.19.2'
- name: Build
run: go build -o semangit .
- name: Smoke test
run: ./semangit --help
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Semangit
[![Main Workflow](https://github.com/emranprojects/semangit/actions/workflows/main.yml/badge.svg)](https://github.com/emranprojects/semangit/actions/workflows/main.yml)
[![Master Workflow](https://github.com/emranprojects/semangit/actions/workflows/master.yml/badge.svg)](https://github.com/emranprojects/semangit/actions/workflows/master.yml)
![Test Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/emranbm/03d07927044bdfe73aee59e6193dd8d5/raw/badge-coverage-semangit.json)
A simple tool to force version update in CI.
We've all experienced commits forgetting to update the corresponding version on the codebase; like changing a helm chart template without increasing the `version` in `Chart.yaml`. *Semangit* helps to prevent such mistakes by checking whether a change needs a corresponding version increase.
Expand Down

0 comments on commit d52a9ee

Please sign in to comment.