diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index ccb1958..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: CI - -on: - pull_request: - push: - -jobs: - verify: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache: true - - - name: Install tooling - run: | - echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - go install github.com/magefile/mage@v1.15.0 - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 - - - name: Gate vet - run: mage vet - - - name: Gate lint - env: - PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} - PUSH_BEFORE_SHA: ${{ github.event.before }} - DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} - run: | - is_usable_rev() { - local rev="$1" - [ -n "$rev" ] && - [ "$rev" != "0000000000000000000000000000000000000000" ] && - git rev-parse --verify "${rev}^{commit}" >/dev/null 2>&1 && - git merge-base --is-ancestor "$rev" HEAD >/dev/null 2>&1 - } - - BASE_SHA="${PR_BASE_SHA:-$PUSH_BEFORE_SHA}" - - if ! is_usable_rev "$BASE_SHA"; then - BASE_SHA="" - fi - - if [ -z "$BASE_SHA" ] && [ -n "$DEFAULT_BRANCH" ]; then - DEFAULT_REF="origin/$DEFAULT_BRANCH" - - if ! git rev-parse --verify "${DEFAULT_REF}^{commit}" >/dev/null 2>&1; then - git fetch --no-tags --depth=1 origin \ - "$DEFAULT_BRANCH:refs/remotes/origin/$DEFAULT_BRANCH" \ - >/dev/null 2>&1 || true - fi - - if git rev-parse --verify "${DEFAULT_REF}^{commit}" >/dev/null 2>&1; then - MERGE_BASE="$(git merge-base HEAD "$DEFAULT_REF" 2>/dev/null || true)" - if is_usable_rev "$MERGE_BASE"; then - BASE_SHA="$MERGE_BASE" - fi - fi - fi - - if [ -z "$BASE_SHA" ]; then - if git rev-parse --verify HEAD~1 >/dev/null 2>&1; then - BASE_SHA="$(git rev-parse HEAD~1)" - else - BASE_SHA="$(git rev-list --max-parents=0 HEAD)" - fi - fi - - echo "Lint baseline: $BASE_SHA" - golangci-lint run --new-from-rev="$BASE_SHA" - - - name: Gate tests - run: mage test |
