From 857bb6827c70e8838246fd0a9272ee486d98ca52 Mon Sep 17 00:00:00 2001 From: Gian <244997+Matrix86@users.noreply.github.com> Date: Fri, 6 Mar 2026 21:23:11 +0100 Subject: [PATCH 1/2] fix: updating github workflows --- .github/workflows/build.yml | 41 +++++++---------------------------- .github/workflows/docker.yml | 29 ++++++++++++++++++++----- .github/workflows/docs.yml | 8 +++---- .github/workflows/release.yml | 34 ++++++++++------------------- 4 files changed, 48 insertions(+), 64 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8992f02..ff664b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,6 @@ name: Build and Test -# This workflow will run on master branch and on any pull requests targeting master on: - push: - branches: - - master - paths-ignore: - - 'docs/**' - - 'src_docs/**' - - '.github/**' pull_request: concurrency: @@ -16,35 +8,18 @@ concurrency: cancel-in-progress: true jobs: - #lint: - # name: Lint - # runs-on: ubuntu-latest - # steps: - # - name: Set up Go - # uses: actions/setup-go@v2 - # with: - # go-version: 1.18 -# - # - name: Check out code - # uses: actions/checkout@v2 -# - # - name: Lint Go Code - # run: | - # go get -u golang.org/x/lint/golint - # make lint - test: name: Test runs-on: ubuntu-latest steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v5 with: go-version: '1.25' - - name: Check out code - uses: actions/checkout@v6 - - name: Run Unit tests. run: make test-coverage @@ -60,13 +35,13 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v5 with: go-version: '1.25' - - name: Check out code - uses: actions/checkout@v6 - - name: Build run: make build \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9a890cc..7fe3cdc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,11 +11,30 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v2 - - name: Push to Docker Hub - uses: docker/build-push-action@v1 + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: matrix86/driplane + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Log in to Docker Hub + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - repository: matrix86/driplane - tag_with_ref: true \ No newline at end of file + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f6d9045..c14a7aa 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,22 +15,22 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@v3 with: - hugo-version: '0.75.1' + hugo-version: 'latest' extended: true - name: Build run: hugo --minify -s src_docs - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: personal_token: ${{ secrets.PERSONAL_TOKEN }} commit_message: ${{ github.event.head_commit.message }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf0c3f2..7da2d0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,16 @@ on: tags: - 'v*' +permissions: + contents: write + jobs: release: name: Release on GitHub runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -19,7 +22,7 @@ jobs: - name: Find Last Tag id: last - uses: jimschubert/query-tag-action@v1 + uses: jimschubert/query-tag-action@v2 with: include: 'v*' exclude: '*-rc*' @@ -28,7 +31,7 @@ jobs: - name: Find Current Tag id: current - uses: jimschubert/query-tag-action@v1 + uses: jimschubert/query-tag-action@v2 with: include: 'v*' exclude: '*-rc*' @@ -37,37 +40,24 @@ jobs: - name: Create Changelog id: changelog - uses: jimschubert/beast-changelog-action@v1 - with: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - CONFIG_LOCATION: .github/changelog.json - FROM: ${{steps.last.outputs.tag}} - TO: ${{steps.current.outputs.tag}} - OUTPUT: .github/CHANGELOG.md + run: | + echo "## Changelog" > .github/CHANGELOG.md + git log --pretty=format:"* %s (%h)" ${{steps.last.outputs.tag}}..${{steps.current.outputs.tag}} >> .github/CHANGELOG.md - name: View Changelog run: cat .github/CHANGELOG.md - name: Validates GO releaser config - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser version: latest args: check - name: Create release on GitHub - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@v6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - args: release --rm-dist --release-notes .github/CHANGELOG.md - #workdir: ./cmd/driplane - - #- name: Create release on GitHub - # uses: docker://goreleaser/goreleaser:latest - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # args: release --rm-dist --release-notes .github/CHANGELOG.md - # workdir: ./cmd/driplane + args: release --clean --release-notes .github/CHANGELOG.md From 98e380e3d15f654d0d56055be1045d7ea29acc99 Mon Sep 17 00:00:00 2001 From: Gian <244997+Matrix86@users.noreply.github.com> Date: Fri, 6 Mar 2026 21:28:28 +0100 Subject: [PATCH 2/2] fix: speeding up the tests using the cache --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff664b0..6cb76f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,15 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.25' + cache-dependency-path: go.sum + + - name: Cache Go build cache + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-go-build-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + ${{ runner.os }}-go-build- - name: Run Unit tests. run: make test-coverage @@ -42,6 +51,15 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.25' + cache-dependency-path: go.sum + + - name: Cache Go build cache + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-go-build-${{ hashFiles('**/*.go', 'go.sum') }} + restore-keys: | + ${{ runner.os }}-go-build- - name: Build run: make build \ No newline at end of file