From d55c6f838307ebca03200b2bc84f1768f28de437 Mon Sep 17 00:00:00 2001 From: Parker Barthlome Date: Tue, 7 Nov 2023 15:35:40 -0700 Subject: [PATCH] Ci fixes (#3) * updating conditions * fixes * Fix * fix keyword --- .github/workflows/ci.yaml | 57 +++++++++++++++++++------------------ .github/workflows/lint.yaml | 4 --- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4838668..ef20087 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,33 +4,36 @@ permissions: contents: read on: pull_request: - branches: - - main push: - branches: - - '*' # matches every branch that doesn't contain a '/' - - '*/*' # matches every branch containing a single '/' - - '**' # matches every branch - - '!master' # excludes master - -runs-on: ubuntu-latest -steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - - - name: generate test coverage - run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... + branches-ignore: + - master + - main - - name: check test coverage - uses: vladopajic/go-test-coverage@v2 - with: - # Configure action using config file (option 1) - config: ./.testcoverage.yml +jobs: + test: + strategy: + matrix: + go: ['1.21'] + os: [ubuntu-latest] + name: test and coverage + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 - # Configure action by specifying input parameters individually (option 2). - # If you are using config file you shouldn't use these parameters. - profile: cover.out - local-prefix: github.com/Pacobart/terraform-cloud-workspace-collector - #threshold-file: 80 # The minimum coverage that each file should have - #threshold-package: 80 # The minimum coverage that each package should have - #threshold-total: 95 # The minimum total coverage project should have \ No newline at end of file + - name: generate test coverage + run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... + + - name: check test coverage + uses: vladopajic/go-test-coverage@v2 + with: + # Configure action using config file (option 1) + config: ./.testcoverage.yml + + # Configure action by specifying input parameters individually (option 2). + # If you are using config file you shouldn't use these parameters. + profile: cover.out + local-prefix: github.com/Pacobart/terraform-cloud-workspace-collector + #threshold-file: 80 # The minimum coverage that each file should have + #threshold-package: 80 # The minimum coverage that each package should have + #threshold-total: 95 # The minimum total coverage project should have \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 9a69d2f..f6bdc3f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,10 +1,6 @@ # https://github.com/marketplace/actions/run-golangci-lint name: golangci-lint on: - push: - branches: - - master - - main pull_request: permissions: