From 5e7766813269b7ae25f0b73c28a297f249e64d9e Mon Sep 17 00:00:00 2001 From: Matthias Simon Date: Tue, 5 Nov 2024 15:29:25 +0100 Subject: [PATCH] Refinements to the CI pipeline - Remove stale workflow - Add golangci-lint to the CI pipeline - Use stable Go version for tests - Enable race condition detection in tests - Change wording --- .github/workflows/BuildAndTest.yml | 25 ---------------------- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 7 +++++-- .github/workflows/stale.yml | 22 -------------------- 4 files changed, 38 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/BuildAndTest.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/BuildAndTest.yml b/.github/workflows/BuildAndTest.yml deleted file mode 100644 index 97130d02..00000000 --- a/.github/workflows/BuildAndTest.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: BuildAndTest - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ^1.16 - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -v ./... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..c1e91a99 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: Continous Integration + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: stable + - name: Test + run: go test -race -v ./... + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.60 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d730bfe1..2e0da6b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,14 +1,15 @@ -name: Release with goreleaser +name: Release on: push: tags: - v*.* jobs: + # Create packages, archives, ... goreleaser: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - - name: Unshallow Fetch + - name: Fetch history run: git fetch --prune --unshallow - uses: actions/setup-go@v2 with: @@ -19,6 +20,8 @@ jobs: args: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Create MSI (Microsoft Installer) for ntt msi: needs: goreleaser runs-on: windows-latest diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index a3d703c0..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Mark stale issues and pull requests - -on: - schedule: - - cron: "30 1 * * *" - -jobs: - stale: - - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days' - stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 90 - days-before-close: 5