diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 4d1876f574..e20661258b 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -14,9 +14,6 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - with: - files: | - **.go - name: List all changed files env: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b46c995bbf..682194e0d0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,88 +1,88 @@ name: Golang CI - -on: - merge_group: - pull_request: - branches: - - '*' -env: - GO_VERSION: '1.21' - -jobs: - changed_files: - name: Changed Files - runs-on: ubutnu-latest - outputs: - changed_files: ${{ steps.changed_files.outputs.all_changed_files }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Changed Files - id: changed_files - uses: ./.github/actions/changed_files - - golang-ci: - needs: - - changed_files - if: | - contains(needs.changed_files.outputs.changed_files, '.go') - name: golangci-lint - runs-on: - labels: 16-cores - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go - with: - cache: false - - name: Load Version - id: load-version - run: | - echo "GOLANGCI_VERSION=v$(cat .golangci-version)" - - name: golangci-ling - uses: golangci/golangci-lint-action@v6 - with: - version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} - args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 - working-directory: ${{ github.workspace }} - - golang-test: - needs: - - changed_files - if: | - contains(needs.changed_files.outputs.changed_files, '.go') || - contains(needs.changed_files.outputs.changed_files, 'go.sum') || - ( - contains(needs.changed_files.outputs.changed_files, '.yml') || - contains(needs.changed_files.outputs.changed_files, '.yaml') - ) - && - ( - contains(needs.changed_files.outputs.changed_files, 'app') || - contains(needs.changed_files.outputs.changed_files, 'client') || - contains(needs.changed_files.outputs.changed_files, 'cmd') || - contains(needs.changed_files.outputs.changed_files, 'migrate') || - contains(needs.changed_files.outputs.changed_files, 'tests') || - contains(needs.changed_files.outputs.changed_files, 'x') - ) - name: go test - runs-on: - labels: 16-cores - env: - COVERAGE_DIR: out/coverage/unit/go - COVERAGE_PATH: out/coverage/unit/go/cover.out - FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out - HTML_REPORT: out/coverage/unit/go/go-unit-cover.html - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go - - name: Go Test - run: | - mkdir -p ${{ env.COVERAGE_DIR }} - readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') - half_nproc=$(( $(nproc --all) / 2 )) - printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race - +# +#on: +# merge_group: +# pull_request: +# branches: +# - '*' +#env: +# GO_VERSION: '1.21' +# +#jobs: +# changed_files: +# name: Changed Files +# runs-on: ubutnu-latest +# outputs: +# changed_files: ${{ steps.changed_files.outputs.all_changed_files }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Changed Files +# id: changed_files +# uses: ./.github/actions/changed_files +# +# golang-ci: +# needs: +# - changed_files +# if: | +# contains(needs.changed_files.outputs.changed_files, '.go') +# name: golangci-lint +# runs-on: +# labels: 16-cores +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Setup +# uses: ./.github/actions/setup_go +# with: +# cache: false +# - name: Load Version +# id: load-version +# run: | +# echo "GOLANGCI_VERSION=v$(cat .golangci-version)" +# - name: golangci-ling +# uses: golangci/golangci-lint-action@v6 +# with: +# version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} +# args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 +# working-directory: ${{ github.workspace }} +# +# golang-test: +# needs: +# - changed_files +# if: | +# contains(needs.changed_files.outputs.changed_files, '.go') || +# contains(needs.changed_files.outputs.changed_files, 'go.sum') || +# ( +# contains(needs.changed_files.outputs.changed_files, '.yml') || +# contains(needs.changed_files.outputs.changed_files, '.yaml') +# ) +# && +# ( +# contains(needs.changed_files.outputs.changed_files, 'app') || +# contains(needs.changed_files.outputs.changed_files, 'client') || +# contains(needs.changed_files.outputs.changed_files, 'cmd') || +# contains(needs.changed_files.outputs.changed_files, 'migrate') || +# contains(needs.changed_files.outputs.changed_files, 'tests') || +# contains(needs.changed_files.outputs.changed_files, 'x') +# ) +# name: go test +# runs-on: +# labels: 16-cores +# env: +# COVERAGE_DIR: out/coverage/unit/go +# COVERAGE_PATH: out/coverage/unit/go/cover.out +# FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out +# HTML_REPORT: out/coverage/unit/go/go-unit-cover.html +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Setup +# uses: ./.github/actions/setup_go +# - name: Go Test +# run: | +# mkdir -p ${{ env.COVERAGE_DIR }} +# readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') +# half_nproc=$(( $(nproc --all) / 2 )) +# printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race +#