From a4c58124dd77ec302d58363fc90389b305b9e678 Mon Sep 17 00:00:00 2001 From: Naoki Kosaka Date: Sun, 10 May 2020 14:06:26 +0900 Subject: [PATCH] Configure GitHub Actions. --- .github/workflows/{main.yml => build.yml} | 28 ++++------------------- .github/workflows/test.yml | 25 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 23 deletions(-) rename .github/workflows/{main.yml => build.yml} (62%) create mode 100644 .github/workflows/test.yml 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