diff --git a/.forgejo/workflows/builds.yml b/.forgejo/workflows/builds.yml new file mode 100644 index 0000000..3df5081 --- /dev/null +++ b/.forgejo/workflows/builds.yml @@ -0,0 +1,20 @@ +on: [pull_request] + +jobs: + builds: + name: Builds + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.19', '1.20' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Build binary + run: make diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml new file mode 100644 index 0000000..85e69a1 --- /dev/null +++ b/.forgejo/workflows/dco.yml @@ -0,0 +1,20 @@ +on: [pull_request] + +jobs: + dco: + name: DCO + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + + - name: Run commit format checker + uses: https://git.alexvan.in/alexvanin/dco-go@v1 + with: + from: 2f41bf22 diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml new file mode 100644 index 0000000..21ac172 --- /dev/null +++ b/.forgejo/workflows/tests.yml @@ -0,0 +1,31 @@ +on: [pull_request] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: golangci-lint + uses: https://github.com/golangci/golangci-lint-action@v2 + with: + version: latest + + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.19', '1.20' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Run tests + run: make test \ No newline at end of file diff --git a/.forgejo/workflows/vulncheck.yml b/.forgejo/workflows/vulncheck.yml new file mode 100644 index 0000000..0c9e908 --- /dev/null +++ b/.forgejo/workflows/vulncheck.yml @@ -0,0 +1,21 @@ +on: [pull_request] + +jobs: + vulncheck: + name: Vulncheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + + - name: Install govulncheck + run: go install golang.org/x/vuln/cmd/govulncheck@latest + + - name: Run govulncheck + run: govulncheck ./... diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml deleted file mode 100644 index df627e6..0000000 --- a/.github/workflows/builds.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Builds - -on: - pull_request: - branches: - - master - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - workflow_dispatch: - -jobs: - build_cli: - name: Build CLI - runs-on: ubuntu-20.04 - strategy: - matrix: - go_os: [ linux, darwin ] - go_arch: [ amd64, arm64 ] - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.19 - - - name: Restore Go modules from cache - uses: actions/cache@v2 - with: - path: /home/runner/go/pkg/mod - key: deps-${{ hashFiles('go.sum') }} - - - name: Update Go modules - run: make dep - - - name: Build CLI - run: BUILD_OS=${{ matrix.go_os }} BUILD_ARCH=${{ matrix.go_arch }} make - - - name: Check version - run: if [[ $(make version) == *"dirty"* ]]; then exit 1; fi - - build_image: - needs: build_cli - name: Build Docker image - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.19 - - - name: Restore Go modules from cache - uses: actions/cache@v2 - with: - path: /home/runner/go/pkg/mod - key: deps-${{ hashFiles('go.sum') }} - - - name: Update Go modules - run: make dep - - - name: Build Docker image - run: make image diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index 40ed8fc..0000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: DCO check - -on: - pull_request: - branches: - - master - -jobs: - commits_check_job: - runs-on: ubuntu-latest - name: Commits Check - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@master - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 20117f4..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Tests - -on: - pull_request: - branches: - - master - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - workflow_dispatch: - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: latest - - cover: - name: Coverage - runs-on: ubuntu-20.04 - - env: - CGO_ENABLED: 1 - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.19 - - - name: Restore Go modules from cache - uses: actions/cache@v2 - with: - path: /home/runner/go/pkg/mod - key: deps-${{ hashFiles('go.sum') }} - - - name: Update Go modules - run: make dep - - - name: Test and write coverage profile - run: make cover - - - name: Upload coverage results to Codecov - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - path_to_write_report: ./coverage.txt - verbose: true - - tests: - name: Tests - runs-on: ubuntu-20.04 - strategy: - matrix: - go_versions: [ '1.17', '1.18.x', '1.19.x' ] - fail-fast: false - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '${{ matrix.go_versions }}' - - - name: Restore Go modules from cache - uses: actions/cache@v2 - with: - path: /home/runner/go/pkg/mod - key: deps-${{ hashFiles('go.sum') }} - - - name: Update Go modules - run: make dep - - - name: Run tests - run: make test