From bbab5ecc8b33ea94e6ee2512a302ecd6f44ef089 Mon Sep 17 00:00:00 2001 From: David Alpert Date: Sun, 19 Nov 2023 11:43:03 -0600 Subject: [PATCH 1/2] build: add ci/cd actions --- .github/workflows/pr.yml | 74 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..f361b38 --- /dev/null +++ b/.github/workflows/pr.yml @@ -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.16.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 From 8fcbbd4b51e903ae5743bf3353f851a2a1b59824 Mon Sep 17 00:00:00 2001 From: David Alpert Date: Sun, 19 Nov 2023 11:18:43 -0600 Subject: [PATCH 2/2] chore: downgrade module version to go 1.17 this should increase the range of clients who can use this library without issue --- .github/workflows/pr.yml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f361b38..7f2f796 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -42,7 +42,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: '1.16.0' + go-version: '1.17.0' - name: Install Task uses: arduino/setup-task@v1 diff --git a/go.mod b/go.mod index be29367..1f36e2a 100644 --- a/go.mod +++ b/go.mod @@ -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