Develop #82
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
name: CI | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
REPO_NAME: ${{ github.event.repository.name }} | |
GOPRIVATE: github.com/sugarshop/* | |
PLANETSCALEDB: ${{ secrets.PLANETSCALEDB }} | |
SUPABASEKEY: ${{ secrets.SUPABASEKEY }} | |
SUPABASEURL: ${{ secrets.SUPABASEURL }} | |
LEMONSQUEEZYAPIKEY: ${{ secrets.LEMONSQUEEZYAPIKEY }} | |
LEMONSQUEEZYASSOCIATEDVARIANTID: ${{ secrets.LEMONSQUEEZYASSOCIATEDVARIANTID }} | |
LEMONSQUEEZYSTOREID: ${{ secrets.LEMONSQUEEZYSTOREID }} | |
on: | |
push: | |
branches: | |
- env.BRANCH_NAME | |
pull_request: | |
branches: | |
- master | |
- develop | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- run: git config --global url.https://${{ secrets.PAT }}@github.com/.insteadOf https://github.com/ | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: env.REPO_NAME | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
cache: false | |
- name: Install RPC | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: sugarshop/rpc | |
ref: master | |
path: rpc | |
- name: Install dependencies | |
working-directory: env.REPO_NAME | |
run: | | |
go mod download | |
go install github.com/cloudwego/kitex/tool/cmd/kitex@v0.5.2 | |
go install github.com/cloudwego/thriftgo@v0.1.2 | |
sh kitex.sh | |
- name: Lint Check | |
uses: dominikh/staticcheck-action@v1.3.0 | |
with: | |
version: "2022.1.3" | |
working-directory: env.REPO_NAME | |
env: | |
GO111MODULE: "on" | |
- name: Run unit tests | |
working-directory: env.REPO_NAME | |
run: | | |
go test -v ./... | |
ut: | |
runs-on: ubuntu-latest | |
steps: | |
- run: git config --global url.https://${{ secrets.PAT }}@github.com/.insteadOf https://github.com/ | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: env.REPO_NAME | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
cache: false | |
- name: Install RPC | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: sugarshop/rpc | |
path: rpc | |
- name: Install dependencies | |
working-directory: env.REPO_NAME | |
run: | | |
export GOPRIVATE=github.com/sugarshop/* | |
go mod download | |
go install github.com/cloudwego/kitex/tool/cmd/kitex@v0.5.2 | |
go install github.com/cloudwego/thriftgo@v0.1.2 | |
sh kitex.sh | |
- name: Run unit tests | |
working-directory: env.REPO_NAME | |
run: | | |
go test -v ./... |