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

build: add ci/cd actions #6

Merged
merged 2 commits into from
Nov 19, 2023
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
74 changes: 74 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Pull Request Feedback

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches:
- main

permissions:
# contents: write
# packages: write
issues: write

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

- name: Fetch all tags
run: git fetch --force --tags

- name: Setup Reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest # Optional. [latest,nightly,v.X.Y.Z]

- name: Vale Linter # https://github.com/marketplace/actions/vale-linter
uses: errata-ai/vale-action@reviewdog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_error: true
files: '["README.md", "CONTRIBUTING.md"]'
filter_mode: nofilter
reporter: github-pr-check
version: 2.17.0

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.17.0'

- name: Install Task
uses: arduino/setup-task@v1

# - name: Setup Ruby, JRuby and TruffleRuby # for integration testing
# uses: ruby/setup-ruby@v1.150.0
# with:
# ruby-version: 3.0.2

- name: Setup build dependencies
run: |
go install github.com/restechnica/semverbot/cmd/sbot@latest
go install github.com/siderolabs/conform/cmd/conform@latest
go install github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.1

# - name: Validate build dependencies
# run: |
# task doctor

- name: Unit tests
run: |
task test

# - name: "Features"
# env:
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# set -o pipefail
# task features | reviewdog -name=features -fail-on-error=true -efm="cucumber %f:%l # Scenario: %m" -diff="git diff FETCH_HEAD" -filter-mode=nofilter -reporter=github-pr-check -tee
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/davidalpert/go-printers

go 1.18
go 1.17

require (
github.com/go-xmlfmt/xmlfmt v0.0.0-20220206211657-0a94163c4677
Expand Down