Skip to content

Commit

Permalink
chore: separate workflows into PR and dev
Browse files Browse the repository at this point in the history
  • Loading branch information
erichartline committed Oct 5, 2020
1 parent dc4e29d commit 71a0e87
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 34 deletions.
35 changes: 1 addition & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
push:
branches:
- develop
pull_request:
branches:
- "**"
jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,34 +32,4 @@ jobs:
uses: codecov/codecov-action@v1.0.2
with:
file: ./profile.cov
token: ${{ secrets.CODECOV_TOKEN }}
automerge:
runs-on: ubuntu-latest
needs: test
if: github.actor == 'dependabot[bot]'
steps:
- name: wait for code cov project to pass
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-codecov-project
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: codecov/project
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: wait for codecov patch to pass
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-codecov-patch
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: codecov/patch
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: merge
if: steps.wait-for-codecov-project.outputs.conclusion == 'success' && steps.wait-for-codecov-patch.outputs.conclusion == 'success'
uses: actions/github-script@v3
with:
script: |
github.pulls.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
merge_method: "rebase"
})
token: ${{ secrets.CODECOV_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/testcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Test coverage
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
arangodb:
image: arangodb:3.6.5
env:
ARANGO_ROOT_PASSWORD: rootpass
ports:
- 8529/tcp
steps:
- name: set up golang
uses: actions/setup-go@v2
with:
go-version: 1.13.15
- name: check out code
uses: actions/checkout@v2
- name: unit test
run: go test -covermode=atomic -coverprofile=profile.cov -cpu 4 -v ./...
env:
GOPROXY: https://proxy.golang.org
ARANGO_USER: root
ARANGO_PASS: rootpass
ARANGO_HOST: localhost
ARANGO_PORT: ${{ job.services.arangodb.ports[8529] }}
- name: upload coverage to codecov
uses: codecov/codecov-action@v1.0.2
with:
file: ./profile.cov
token: ${{ secrets.CODECOV_TOKEN }}
automerge:
runs-on: ubuntu-latest
needs: test
if: github.actor == 'dependabot[bot]'
steps:
- name: wait for code cov project to pass
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-codecov-project
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: codecov/project
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: wait for codecov patch to pass
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-codecov-patch
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: codecov/patch
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: merge
if: steps.wait-for-codecov-project.outputs.conclusion == 'success' && steps.wait-for-codecov-patch.outputs.conclusion == 'success'
uses: actions/github-script@v3
with:
script: |
github.pulls.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
merge_method: "rebase"
})

0 comments on commit 71a0e87

Please sign in to comment.