diff --git a/.github/workflows/main.yml b/.github/workflows/build.yml similarity index 62% rename from .github/workflows/main.yml rename to .github/workflows/build.yml index 8136bf6..c79aed7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/build.yml @@ -1,28 +1,10 @@ -name: Test and Build -on: [push] +name: Build +on: + push: + branches: + - master jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: actions/setup-go@v1 - with: - go-version: '1.13.x' - - name: Execute test and upload coverage - run: | - go version - go test -coverprofile=coverage.txt -covermode=atomic -p 1 . ./worker ./cli ./State - bash <(curl -s https://codecov.io/bash) - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }} - services: - redis: - image: redis - ports: - - 6379/tcp build: name: Build runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c9bd869 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: Test +on: [push, pull_request] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-go@v1 + with: + go-version: '1.13.x' + - name: Execute test and upload coverage + run: | + go version + go test -coverprofile=coverage.txt -covermode=atomic -p 1 . ./worker ./cli ./State + bash <(curl -s https://codecov.io/bash) + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }} + services: + redis: + image: redis + ports: + - 6379/tcp