diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 73172587..5833501e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,47 +1,12 @@ name: Test Baton Gitlab Integration -on: pull_request +on: + pull_request: + push: + branches: + - main jobs: - go-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - name: Run linters - uses: golangci/golangci-lint-action@v8 - with: - version: latest - args: --timeout=3m - - go-test: - strategy: - matrix: - platform: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.platform }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Go - if: success() - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - name: go tests - run: go test -v -covermode=count -json ./... > test.json - - name: Print go test results - if: always() - run: cat test.json - - name: annotate go tests - if: always() - uses: guyarb/golang-test-annotations@v0.8.0 - with: - test-results: test.json - # this test is commented because it fails to run due to lack of memory in ci test. # test-DC-version: # runs-on: ubuntu-latest @@ -190,6 +155,7 @@ jobs: # jq --exit-status ".grants[].principal.id.resource == \"${{ env.USER_ID }}\"" test-cloud-version: + if: github.event_name == 'pull_request' runs-on: ubuntu-latest env: BATON_LOG_LEVEL: debug diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index dba9bd2d..00000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: main ci -on: - push: - branches: - - main -jobs: - go-lint: - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.23.x - - name: Checkout code - uses: actions/checkout@v3 - - name: Run linters - uses: golangci/golangci-lint-action@v8 - with: - version: latest - args: --timeout=3m - go-test: - strategy: - matrix: - go-version: [ 1.23.x ] - platform: [ ubuntu-latest ] - runs-on: ${{ matrix.platform }} - steps: - - name: Install Go - if: success() - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v4 - - name: go tests - run: (set -o pipefail && go test -v -covermode=count -json ./... | tee test.json) - - name: annotate go tests - if: always() - uses: guyarb/golang-test-annotations@v0.5.1 - with: - test-results: test.json \ No newline at end of file