From 5ebd13ed7609db840b28de160442108bbc4ca042 Mon Sep 17 00:00:00 2001 From: Bruno Carlin Date: Sat, 18 Jan 2025 00:58:39 +0100 Subject: [PATCH] feat: add ci config for forgejo tmp --- .forgejo/workflows/test.yml | 20 +++++++++++ .gitlab-ci.yml | 71 ------------------------------------- 2 files changed, 20 insertions(+), 71 deletions(-) create mode 100644 .forgejo/workflows/test.yml delete mode 100644 .gitlab-ci.yml diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..fb11cfe --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,20 @@ +on: [push] +jobs: + linting: + runs-on: docker + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - uses: https://github.com/golangci/golangci-lint-action@v6 + tests: + runs-on: docker + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: Run tests + run: go test + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 07bc7a9..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,71 +0,0 @@ -image: golang:latest - -stages: - - test - - build - - release - -variables: - GOPATH: "${CI_PROJECT_DIR}/.gocache" - GOLANGCI_LINT_CACHE: "${GOPATH}/golangci-lint_cache" - GOCACHE: "${GOPATH}/go-build" - -.cache: &depscache - key: $CI_COMMIT_REF_SLUG - paths: - - $CI_PROJECT_DIR/.gocache - -code_navigation: - stage: test - image: sourcegraph/lsif-go:latest - allow_failure: true # recommended - script: - - lsif-go --no-animation - - ls -lh dump.lsif - artifacts: - reports: - lsif: dump.lsif - -lint: - stage: test - image: golangci/golangci-lint:latest - script: - - golangci-lint cache status - - golangci-lint run --timeout 5m --out-format junit-xml > lint.junit.xml - cache: - <<: *depscache - policy: pull-push - artifacts: - reports: - junit: lint.junit.xml - -tests: - stage: test - script: - - go install gotest.tools/gotestsum@latest - - gotestsum --junitfile tests.junit.xml -- -coverprofile=coverage.txt -covermode atomic -race ./... - after_script: - - export PATH="$PATH:$GOPATH/bin" - - go install github.com/boumenot/gocover-cobertura@latest - - gocover-cobertura < coverage.txt > coverage.xml - - go tool cover -func=coverage.txt | grep "total:" - coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/' - cache: - <<: *depscache - policy: pull-push - artifacts: - reports: - cobertura: coverage.xml - junit: tests.junit.xml - -release: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - rules: - - if: $CI_COMMIT_TAG - script: - - | - release-cli create \ - --name "${CI_COMMIT_TAG}" \ - --tag-name "${CI_COMMIT_TAG}" \ - --milestone "${CI_COMMIT_TAG}"