Skip to content

Commit

Permalink
ci:#2 implements (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-r-k-matsumoto committed Nov 28, 2020
1 parent 94d5e24 commit 76d570c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pull Request

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: download modules
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download
- name: build
run: go build .
- name: test
run: go test -json ./... > test.json
- name: annotate tests
if: always()
uses: guyarb/golang-test-annotations@v0.2.0
with:
test-results: test.json
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: test
run: |
go get -u golang.org/x/lint/golint
golint -set_exit_status ./...
11 changes: 10 additions & 1 deletion .github/workflows/build.yml → .github/workflows/releease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build:
name: Build
name: build
runs-on: ubuntu-latest
steps:
- name: checkout
Expand Down Expand Up @@ -42,6 +42,15 @@ jobs:
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.TAG_VERSION }}
release:
name: release
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (
)

func TestRun(t *testing.T) {
if os.Getenv("GITHUB_RUN_ID") != "" {
t.Skip("This test not running at GitHub Action env")
}
os.Setenv("PASSENGER_INSTANCE_REGISTRY_DIR", "/sock")

statusc := make(chan string) //startup message channel.
Expand Down

0 comments on commit 76d570c

Please sign in to comment.