From 9957380b6de52aaee826ea2b1ffc87bd6ee06279 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 17 Sep 2021 07:41:17 +0300 Subject: [PATCH] update workflows Signed-off-by: Vasiliy Tolstov --- .github/workflows/build.yml | 28 +++++----------------- .github/workflows/codeql-analysis.yml | 4 ++++ .github/workflows/dependabot-automerge.yml | 3 +++ .github/workflows/pr.yml | 28 +++++----------------- 4 files changed, 19 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b2c833a..eb19b680 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: build on: - push: + push: branches: - master jobs: @@ -12,36 +12,20 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.16 + - name: checkout + uses: actions/checkout@v2 - name: cache uses: actions/cache@v2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- - - name: sdk checkout - uses: actions/checkout@v2 - - name: sdk deps + - name: deps run: go get -v -t -d ./... - - name: sdk test + - name: test env: INTEGRATION_TESTS: yes run: go test -mod readonly -v ./... - - name: tests checkout - uses: actions/checkout@v2 - with: - repository: unistack-org/micro-tests - ref: refs/heads/master - path: micro-tests - fetch-depth: 1 - - name: tests deps - run: | - cd micro-tests - go mod edit -replace="github.com/unistack-org/micro/v3=../" - go get -v -t -d ./... - - name: tests test - env: - INTEGRATION_TESTS: yes - run: cd micro-tests && go test -mod readonly -v ./... lint: name: lint runs-on: ubuntu-latest @@ -53,7 +37,7 @@ jobs: continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.39 + version: v1.30 # Optional: working directory, useful for monorepos # working-directory: somedir # Optional: golangci-lint command line arguments. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f4f21528..fa4081ef 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,6 +12,10 @@ name: "CodeQL" on: + workflow_run: + workflows: ["prbuild"] + types: + - completed push: branches: [ master ] pull_request: diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index b9628e74..a4dfa48d 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest # Contains workaround to execute if dependabot updates the PR by checking for the base branch in the linked PR # The the github.event.workflow_run.event value is 'push' and not 'pull_request' + # dont work with multiple workflows when last returns success if: >- github.event.workflow_run.conclusion == 'success' && github.actor == 'dependabot[bot]' @@ -23,6 +24,8 @@ jobs: && (github.event.workflow_run.event == 'pull_request' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.pull_requests[0].base.ref == github.event.repository.default_branch )) steps: + - name: Wait workflows success + uses: ahmadnassri/action-workflow-run-wait@v1 - name: Approve Changes and Merge changes if label 'dependencies' is set uses: actions/github-script@v4 with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5ca11ff9..545baf2b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,36 +12,20 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.16 + - name: checkout + uses: actions/checkout@v2 - name: cache uses: actions/cache@v2 with: - path: ~/go/pkg + path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- - - name: sdk checkout - uses: actions/checkout@v2 - - name: sdk deps + - name: deps run: go get -v -t -d ./... - - name: sdk test + - name: test env: INTEGRATION_TESTS: yes run: go test -mod readonly -v ./... - - name: tests checkout - uses: actions/checkout@v2 - with: - repository: unistack-org/micro-tests - ref: refs/heads/master - path: micro-tests - fetch-depth: 1 - - name: tests deps - run: | - cd micro-tests - go mod edit -replace="github.com/unistack-org/micro/v3=../" - go get -v -t -d ./... - - name: tests test - env: - INTEGRATION_TESTS: yes - run: cd micro-tests && go test -mod readonly -v ./... lint: name: lint runs-on: ubuntu-latest @@ -53,7 +37,7 @@ jobs: continue-on-error: true with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.39 + version: v1.30 # Optional: working directory, useful for monorepos # working-directory: somedir # Optional: golangci-lint command line arguments.