diff --git a/.forgejo/workflows/sonarqube.yml b/.forgejo/workflows/sonarqube.yml deleted file mode 100644 index b658a85..0000000 --- a/.forgejo/workflows/sonarqube.yml +++ /dev/null @@ -1,45 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Winni Neessen -# -# SPDX-License-Identifier: CC0-1.0 - -name: SonarQube -on: - push: - branches: - - main # or the name of your main branch - pull_request: - branches: - - main # or the name of your main branch -env: - API_KEY: ${{ secrets.API_KEY }} -jobs: - build: - name: Build - runs-on: docker - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: '1.22' - - - name: Run unit Tests - run: | - go test -v -shuffle=on -race --coverprofile=./cov.out ./... - - - name: Install jq - run: | - apt-get update; apt-get -y install jq; which jq - - - uses: sonarsource/sonarqube-scan-action@master - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - - - uses: sonarsource/sonarqube-quality-gate-action@master - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..0982166 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: 2022 Winni Neessen +# +# SPDX-License-Identifier: CC0-1.0 + +name: Codecov workflow +on: + push: + branches: + - main + paths: + - '**.go' + - 'go.*' + - '.github/**' + - 'codecov.yml' + pull_request: + branches: + - main + paths: + - '**.go' + - 'go.*' + - '.github/**' + - 'codecov.yml' +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + go: ['1.22'] + steps: + - name: Checkout Code + uses: actions/checkout@master + - name: Setup go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go }} + - name: Run Tests + run: | + go test -v -race --coverprofile=coverage.coverprofile --covermode=atomic ./... + - name: Upload coverage to Codecov + if: success() && matrix.go == '1.22' && matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos \ No newline at end of file diff --git a/.forgejo/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml similarity index 91% rename from .forgejo/workflows/golangci-lint.yml rename to .github/workflows/golangci-lint.yml index a2bc22a..3700e65 100644 --- a/.forgejo/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022 Winni Neessen +# SPDX-FileCopyrightText: 2022 Winni Neessen # # SPDX-License-Identifier: CC0-1.0 @@ -17,9 +17,9 @@ permissions: jobs: golangci: name: lint - runs-on: docker + runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v3 with: go-version: '1.22' - uses: actions/checkout@v3 diff --git a/.github/workflows/release-bsd.yml b/.github/workflows/release-bsd.yml deleted file mode 100644 index 703e2c9..0000000 --- a/.github/workflows/release-bsd.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2024 Winni Neessen -# -# SPDX-License-Identifier: CC0-1.0 - -name: Go - -on: - workflow_dispatch: - release: - types: [ created ] - -jobs: - releases-matrix: - name: Release Go Binary (BSDs) - runs-on: ubuntu-latest - strategy: - matrix: - goos: [freebsd, netbsd, openbsd] - goarch: ["386", amd64, arm, arm64] - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.26 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - binary_name: "apg" - extra_files: LICENSE README.md - sha256sum: true - md5sum: false - ldflags: '-s -w' - project_path: ./cmd/apg/ diff --git a/.github/workflows/release-darwin.yml b/.github/workflows/release-darwin.yml deleted file mode 100644 index d4c793d..0000000 --- a/.github/workflows/release-darwin.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2024 Winni Neessen -# -# SPDX-License-Identifier: CC0-1.0 - -name: Go - -on: - workflow_dispatch: - release: - types: [ created ] - -jobs: - releases-matrix: - name: Release Go Binary (Darwin) - runs-on: ubuntu-latest - strategy: - matrix: - goos: [darwin] - goarch: [amd64, arm64] - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.26 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - binary_name: "apg" - extra_files: LICENSE README.md - sha256sum: true - md5sum: false - ldflags: '-s -w' - project_path: ./cmd/apg/ diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml deleted file mode 100644 index 4bfa457..0000000 --- a/.github/workflows/release-linux.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2024 Winni Neessen -# -# SPDX-License-Identifier: CC0-1.0 - -name: Go - -on: - workflow_dispatch: - release: - types: [ created ] - -jobs: - releases-matrix: - name: Release Go Binary (Linux) - runs-on: ubuntu-latest - strategy: - matrix: - goos: [linux] - goarch: ["386", amd64, arm, arm64, ppc64le, s390x] - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.26 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - binary_name: "apg" - extra_files: LICENSE README.md - sha256sum: true - md5sum: false - ldflags: '-s -w' - project_path: ./cmd/apg/ diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml deleted file mode 100644 index ee41e2b..0000000 --- a/.github/workflows/release-windows.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2024 Winni Neessen -# -# SPDX-License-Identifier: CC0-1.0 - -name: Go - -on: - workflow_dispatch: - release: - types: [ created ] - -jobs: - releases-matrix: - name: Release Go Binary (Windows) - runs-on: ubuntu-latest - strategy: - matrix: - goos: [windows] - goarch: ["386", amd64, arm] - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.26 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - binary_name: "apg" - extra_files: LICENSE README.md - sha256sum: true - md5sum: false - ldflags: '-s -w' - project_path: ./cmd/apg/ diff --git a/.forgejo/workflows/reuse.yml b/.github/workflows/reuse.yml similarity index 70% rename from .forgejo/workflows/reuse.yml rename to .github/workflows/reuse.yml index accbbf5..0c3715b 100644 --- a/.forgejo/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 Winni Neessen +# SPDX-FileCopyrightText: 2022 Winni Neessen # # SPDX-License-Identifier: CC0-1.0 @@ -8,7 +8,7 @@ on: [push, pull_request] jobs: test: - runs-on: docker + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: REUSE Compliance Check