-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6eb9d4e
Showing
283 changed files
with
19,458 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
name: CI Actions | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
workflow: | ||
name: Lint/Build/Test | ||
|
||
strategy: | ||
matrix: | ||
go-version: [1.18.x] | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- name: Configure git for private modules | ||
env: | ||
TOKEN: ${{ secrets.RESTRICTED_REPO_TOKEN}} | ||
run: git config --global url."https://${TOKEN}:[email protected]/".insteadOf "https://github.com/" | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{matrix.go-version}} | ||
|
||
- name: Checkout Code Base | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Restore Go Module Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/internal/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Make Lint | ||
run: | | ||
export GOPATH=$HOME/go | ||
export PATH=$PATH:$GOPATH/bin | ||
export GOPRIVATE=github.com/AfterShip/* | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3 | ||
go mod tidy | ||
make lint | ||
- name: Test | ||
run: make test | ||
|
||
- name: SonarQube Scan On PR | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: sonarsource/sonarqube-scan-action@master | ||
with: | ||
projectBaseDir: . | ||
args: > | ||
-Dsonar.go.coverage.reportPaths=coverage.out | ||
-Dsonar.exclusions=**/*_test.go,**/*.gen.go,**/*.py | ||
-Dsonar.projectKey=${{ github.event.repository.name }} | ||
-Dsonar.pullrequest.provider=github | ||
-Dsonar.pullrequest.github.repository=${{ github.repository }} | ||
-Dsonar.pullrequest.key=${{ github.event.number }} | ||
-Dsonar.pullrequest.branch=PR | ||
-Dsonar.pullrequest.base=${{ github.base_ref }} | ||
-Dsonar.qualitygate.wait=true | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
|
||
- name: Get branch name (merge) | ||
if: ${{ github.event_name != 'pull_request' }} | ||
shell: bash | ||
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | ||
|
||
- name: SonarQube Scan On Push | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: sonarsource/sonarqube-scan-action@master | ||
with: | ||
projectBaseDir: . | ||
args: > | ||
-Dsonar.go.coverage.reportPaths=coverage.out | ||
-Dsonar.exclusions=**/*_test.go,**/*.gen.go,**/*.py | ||
-Dsonar.projectKey=${{ github.event.repository.name }} | ||
-Dsonar.pullrequest.provider=github | ||
-Dsonar.pullrequest.github.repository=${{ github.repository }} | ||
-Dsonar.branch.name=${{ env.BRANCH_NAME }} | ||
-Dsonar.qualitygate.wait=true | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
.vscode | ||
.idea | ||
.DS_Store | ||
|
||
# Binary | ||
main | ||
clickhouse-sql-parser |
Oops, something went wrong.