From c3823ed6780bb48c22da6a88daaf3a814a7ab611 Mon Sep 17 00:00:00 2001 From: John Weldon Date: Thu, 26 Dec 2024 14:22:55 -0700 Subject: [PATCH] Update workflows to only use v3 directory Also, disable fuzzing until configured correctly in upstream repo --- .github/workflows/cifuzz.yml | 63 +++++++++++++++--------------- .github/workflows/lint.yml | 5 ++- .github/workflows/pr.yml | 74 ++++++++++++++++-------------------- 3 files changed, 67 insertions(+), 75 deletions(-) diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index 12812797..0376804c 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -2,34 +2,35 @@ name: CIFuzz on: [pull_request] permissions: {} jobs: - Fuzzing: - runs-on: ubuntu-latest - permissions: - security-events: write - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'go-ldap' - language: go - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'go-ldap' - language: go - fuzz-seconds: 300 - output-sarif: true - - name: Upload Crash - uses: actions/upload-artifact@v3 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts - - name: Upload Sarif - if: always() && steps.build.outcome == 'success' - uses: github/codeql-action/upload-sarif@v2 - with: - # Path to SARIF file relative to the root of the repository - sarif_file: cifuzz-sarif/results.sarif - checkout_path: cifuzz-sarif + Fuzzing: + if: false # Until go-fuzz project is updated to use v3 directory + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - name: Build Fuzzers + id: build + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: "go-ldap" + language: go + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: "go-ldap" + language: go + fuzz-seconds: 300 + output-sarif: true + - name: Upload Crash + uses: actions/upload-artifact@v3 + if: failure() && steps.build.outcome == 'success' + with: + name: artifacts + path: ./out/artifacts + - name: Upload Sarif + if: always() && steps.build.outcome == 'success' + uses: github/codeql-action/upload-sarif@v2 + with: + # Path to SARIF file relative to the root of the repository + sarif_file: cifuzz-sarif/results.sarif + checkout_path: cifuzz-sarif diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4f47342e..f6be5282 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,7 +1,7 @@ name: golangci-lint on: pull_request: - branches: [ master ] + branches: [master] permissions: contents: read @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: "1.23" cache: false - uses: actions/checkout@v4 - name: golangci-lint @@ -21,3 +21,4 @@ jobs: with: version: latest only-new-issues: true + working-directory: v3 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1dc683ca..d11f92d5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,54 +2,44 @@ name: PR on: pull_request: - branches: [ master ] + branches: [master] jobs: - build: + build-and-test: runs-on: ubuntu-latest strategy: matrix: - go: [ - '1.23', - '1.22', - '1.21', - '1.20', - '1.19', - '1.18', - '1.17', - '1.16', - '1.15', - '1.14', - ] - branch: [ '.', './v3' ] - name: Go ${{ matrix.go }}.x PR Validate ${{ matrix.branch }} (Modules) + go: + [ + "1.23", + "1.22", + "1.21", + "1.20", + "1.19", + "1.18", + "1.17", + "1.16", + "1.15", + "1.14", + ] + directory: ["./v3"] + name: Go ${{ matrix.go }}.x PR Validate ${{ matrix.directory }} (Modules) steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go }} - - - name: Version - run: go version + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} - - name: Build and Validate - run: | - cd ${{ matrix.branch }} - go vet . - go test . - go test -cover -race -cpu 1,2,4 . - go build . + - name: Version + run: go version - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: latest - only-new-issues: true + - name: Build, Validate, and Test + run: | + cd ${{ matrix.directory }} + go vet . + go test . + go test -cover -race -cpu 1,2,4 . + go build .