From 188e829dd79353063a5aa17e0567bf08a2a79a24 Mon Sep 17 00:00:00 2001 From: Pure White Date: Mon, 20 Dec 2021 19:56:07 +0800 Subject: [PATCH] chore(ci): setup self-hosted runner for ci (#158) --- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/license-check.yml | 14 ++++++++++++++ .github/workflows/pr-check.yml | 6 +++--- .github/workflows/push-check-go115.yml | 4 ++-- .github/workflows/push-check-go116.yml | 4 ++-- .github/workflows/push-check-go117.yml | 9 ++------- 6 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/license-check.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e8cd72a15..4cf7318b1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: self-hosted permissions: actions: read contents: read @@ -44,7 +44,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - uses: actions/cache@v2 with: diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml new file mode 100644 index 000000000..60f1c99b0 --- /dev/null +++ b/.github/workflows/license-check.yml @@ -0,0 +1,14 @@ +name: License Check + +on: push + +jobs: + build: + runs-on: self-hosted + steps: + - uses: actions/checkout@v2 + + - name: Check License Header + uses: apache/skywalking-eyes@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 30e8264d0..6285e1ac6 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -4,7 +4,7 @@ on: pull_request jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v2 @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - uses: actions/cache@v2 with: @@ -24,4 +24,4 @@ jobs: ${{ runner.os }}-go- - name: Benchmark - run: go test -bench=. -benchmem -run=none ./... + run: GOMAXPROCS=4 go test -bench=. -benchmem -run=none ./... diff --git a/.github/workflows/push-check-go115.yml b/.github/workflows/push-check-go115.yml index 981d0657c..fcd8d903d 100644 --- a/.github/workflows/push-check-go115.yml +++ b/.github/workflows/push-check-go115.yml @@ -4,7 +4,7 @@ on: push jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v2 @@ -21,4 +21,4 @@ jobs: ${{ runner.os }}-go- - name: Unit Test - run: go test -v -covermode=atomic -coverprofile=coverage.out ./... + run: GOMAXPROCS=4 go test -v -covermode=atomic -coverprofile=coverage.out ./... diff --git a/.github/workflows/push-check-go116.yml b/.github/workflows/push-check-go116.yml index 6d0960ac9..fdfa57fba 100644 --- a/.github/workflows/push-check-go116.yml +++ b/.github/workflows/push-check-go116.yml @@ -4,7 +4,7 @@ on: push jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v2 @@ -21,4 +21,4 @@ jobs: ${{ runner.os }}-go- - name: Unit Test - run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./... + run: GOMAXPROCS=4 go test -v -race -covermode=atomic -coverprofile=coverage.out ./... diff --git a/.github/workflows/push-check-go117.yml b/.github/workflows/push-check-go117.yml index 13c083b84..54a73f331 100644 --- a/.github/workflows/push-check-go117.yml +++ b/.github/workflows/push-check-go117.yml @@ -4,7 +4,7 @@ on: push jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v2 @@ -20,10 +20,5 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Check License Header - uses: apache/skywalking-eyes@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Unit Test - run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./... + run: GOMAXPROCS=4 go test -v -race -covermode=atomic -coverprofile=coverage.out ./...