From 71be7f83cf9823c4f198dfe812f07b6263776190 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 27 Jan 2024 14:55:09 -0500 Subject: [PATCH 1/3] fix: update GitHub workflows to work private asdf Go fork --- .github/workflows/semantic-pr.yml | 14 ++++++++++++++ .github/workflows/tests.yml | 2 -- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index 5195dac5..fda8238d 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -14,3 +14,17 @@ jobs: - uses: amannn/action-semantic-pull-request@v5.5.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + scopes: | + # The scope for all the Golang rewrite commits + golang-rewrite + # A list of all used scopes can be computed by running this command: + # + # git log --pretty=format:%s | rg '^[^: ]*\(([^):]*)\).*' -r '$1' | sort | uniq + # + # We only want to allow a limited set of scopes going forward, so + # the list of valid scopes has been pared down here. + docs + website + plugin + completions diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c32c34d..36ac21f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,8 +9,6 @@ on: jobs: detect-changes: runs-on: ubuntu-latest - permissions: - pull-requests: read # Set job outputs to values from filter step outputs: documentation: ${{ steps.filter.outputs.documentation }} From d8afc037c778495554734e3d4f1c4b6d55da0ff5 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 27 Jan 2024 15:28:35 -0500 Subject: [PATCH 2/3] feat: add linting for Golang to GitHub lint workflow --- .github/workflows/lint.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 85622cc3..ebe46d91 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,7 @@ env: PYTHON_MIN_VERSION: "3.7.13" jobs: - asdf: + asdf-bash: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -21,6 +21,25 @@ jobs: - run: scripts/install_dependencies.bash - run: scripts/lint.bash --check + asdf-golang: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.5' + - name: Install dependencies + run: go get . + - name: Check format + run: '[ -z "$(gofmt -l ./...)" ]' + - name: Vet + run: go vet + - name: Install staticcheck for linting + run: go install honnef.co/go/tools/cmd/staticcheck@latest + - name: Lint + run: staticcheck -tests -show-ignored ./... + actions: runs-on: ubuntu-latest steps: From 3c876d25cd625a995539da7447ea8a0595f492ae Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 27 Jan 2024 15:35:27 -0500 Subject: [PATCH 3/3] feat: add Golang tests to GitHub test workflow --- .github/workflows/lint.yml | 2 ++ .github/workflows/tests.yml | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ebe46d91..dbc3f287 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -39,6 +39,8 @@ jobs: run: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Lint run: staticcheck -tests -show-ignored ./... + - name: Build + run: build -v ./... actions: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36ac21f6..a4978930 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,21 @@ jobs: - 'defaults' - 'help.txt' + test-golang: + needs: detect-changes + if: ${{ needs.detect-changes.outputs.cli == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.5' + - name: Install dependencies + run: go get . + - name: Run Go tests + run: go test + ubuntu: needs: detect-changes # only run if