[Test] test ci #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#- | |
# #%L | |
# OBKV Table Client Framework | |
# %% | |
# Copyright (C) 2023 OceanBase | |
# %% | |
# OBKV Table Client Framework is licensed under Mulan PSL v2. | |
# You can use this software according to the terms and conditions of the Mulan PSL v2. | |
# You may obtain a copy of Mulan PSL v2 at: | |
# http://license.coscl.org.cn/MulanPSL2 | |
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |
# See the Mulan PSL v2 for more details. | |
# #L% | |
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
- name: Cache Go modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install dependencies | |
run: go mod download | |
- name: Build | |
run: | | |
go list ./... | grep -v /example/ | grep -v /test/ | xargs -L 1 go build -v | |
- name: Run unit tests | |
run: | | |
go test -v $(go list ./... | grep -v /test/ | grep -v /example/) |