From 4e963c99ce23ce6838b4bca351f767460601f34a Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Tue, 15 Dec 2020 10:02:55 -0800 Subject: Cleanup GitHub actions workflows. Also, drop the pull_request template, since this has not proved to be helpful, and just results in a commit message the includes the list. PiperOrigin-RevId: 347636507 --- .github/workflows/go.yml | 46 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) (limited to '.github/workflows/go.yml') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3a6a592d1..c87ab22ef 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,12 +1,12 @@ +# This workflow generates the Go branch. Note that this does not test the Go +# branch, as this is rolled into the main continuous integration pipeline. This +# workflow simply generates and pushes the branch, as long as appropriate +# permissions are available. name: "Go" on: push: branches: - master - pull_request: - branches: - - master - - feature/** jobs: generate: @@ -19,20 +19,13 @@ jobs: else echo ::set-output name=has_token::false fi - - run: | - jq -nc '{"state": "pending", "context": "go tests"}' | \ - curl -sL -X POST -d @- \ - -H "Content-Type: application/json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "${{ github.event.pull_request.statuses_url }}" - if: github.event_name == 'pull_request' - uses: actions/checkout@v2 - if: github.event_name == 'push' && steps.setup.outputs.has_token == 'true' + if: steps.setup.outputs.has_token == 'true' with: fetch-depth: 0 token: '${{ secrets.GO_TOKEN }}' - uses: actions/checkout@v2 - if: github.event_name == 'pull_request' || steps.setup.outputs.has_token != 'true' + if: steps.setup.outputs.has_token != 'true' with: fetch-depth: 0 - uses: actions/setup-go@v2 @@ -50,32 +43,7 @@ jobs: key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }} restore-keys: | ${{ runner.os }}-bazel- - # Create gopath to merge the changes. The first execution will create - # symlinks to the cache, e.g. bazel-bin. Once the cache is setup, delete - # old gopath files that may exist from previous runs (and could contain - # files that are now deleted). Then run gopath again for good. - - run: | - make build TARGETS="//:gopath" - rm -rf bazel-bin/gopath - make build TARGETS="//:gopath" - - run: tools/go_branch.sh - - run: git checkout go && git clean -f - - run: go build ./... - - if: github.event_name == 'push' + - run: make go run: | git remote add upstream "https://github.com/${{ github.repository }}" git push upstream go:go - - if: ${{ success() && github.event_name == 'pull_request' }} - run: | - jq -nc '{"state": "success", "context": "go tests"}' | \ - curl -sL -X POST -d @- \ - -H "Content-Type: application/json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "${{ github.event.pull_request.statuses_url }}" - - if: ${{ failure() && github.event_name == 'pull_request' }} - run: | - jq -nc '{"state": "failure", "context": "go tests"}' | \ - curl -sL -X POST -d @- \ - -H "Content-Type: application/json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "${{ github.event.pull_request.statuses_url }}" -- cgit v1.2.3