diff --git a/.github/workflows/autoapprove.yml b/.github/workflows/autoapprove.yml new file mode 100644 index 00000000..ebe28c91 --- /dev/null +++ b/.github/workflows/autoapprove.yml @@ -0,0 +1,20 @@ +name: "autoapprove" + +on: + pull_request_target: + types: [assigned, opened, synchronize, reopened] + +permissions: + pull-requests: write + contents: write + +jobs: + autoapprove: + runs-on: ubuntu-latest + steps: + - name: approve + uses: hmarr/auto-approve-action@v2 + if: github.actor == 'vtolstov' || github.actor == 'dependabot[bot]' + id: approve + with: + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..5ff3f699 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,21 @@ +name: "automerge" + +on: + pull_request_target: + types: [assigned, opened, synchronize, reopened] + +permissions: + pull-requests: write + contents: write + +jobs: + automerge: + runs-on: ubuntu-latest + if: github.actor == 'vtolstov' + steps: + - name: merge + id: merge + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.TOKEN}} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 420d45c2..ddc52536 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: build on: - push: + push: branches: - master - v3 @@ -13,48 +13,32 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.17 + - name: checkout + uses: actions/checkout@v3 - 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 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: lint uses: golangci/golangci-lint-action@v3.1.0 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 429992c6..b3d478ec 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: setup uses: actions/setup-go@v2 with: diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 69e4c396..3681028e 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -1,4 +1,4 @@ -name: "prautomerge" +name: "dependabot-automerge" on: pull_request_target: @@ -9,21 +9,17 @@ permissions: contents: write jobs: - dependabot: + automerge: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} + if: github.actor == 'dependabot[bot]' steps: - name: metadata id: metadata - uses: dependabot/fetch-metadata@v1.1.1 + uses: dependabot/fetch-metadata@v1.3.0 with: github-token: "${{ secrets.TOKEN }}" - - name: approve - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.TOKEN}} - name: merge + id: merge if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}} run: gh pr merge --auto --merge "$PR_URL" env: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 295406e0..b6a63456 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,48 +13,32 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.17 + - name: checkout + uses: actions/checkout@v3 - 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 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: lint uses: golangci/golangci-lint-action@v3.1.0 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.