feat: support bearer token #490
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
on: | |
push: | |
branches: ['main'] | |
paths: | |
- "go/**" | |
- "python/qianfan/tests/utils/mock_server.py" | |
- ".github/workflows/go_ci.yml" | |
pull_request: | |
paths: | |
- "go/**" | |
- "python/qianfan/tests/utils/mock_server.py" | |
- ".github/workflows/go_ci.yml" | |
workflow_dispatch: | |
name: Go CI | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Unit tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
- 'macos-latest' | |
- 'windows-latest' | |
go-version: [ '1.19', '1.20', '1.21.x' ] | |
python-version: [ '3.11' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
cd python && poetry lock | |
- name: Setup Python Cache | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.python-version}} | |
cache: "poetry" | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache-dependency-path: go/qianfan/go.mod | |
- name: Display version | |
run: | | |
go version | |
python --version | |
poetry --version | |
- name: Install deps | |
run: | | |
make install | |
- name: Disable ntp on MacOS | |
if: runner.os == 'macOS' | |
run: | | |
sudo systemsetup -setusingnetworktime off | |
sudo rm -rf /etc/ntp.conf | |
- name: Run test | |
run: | | |
make mock | |
make -C go test | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
working-directory: go/qianfan |