-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: mv src to python * init go * optimize * support stream * optimize code * optimize code * add ut * add ut * add ci * update go version * update ci * fix mock server * update script * update script * fix makefile * update script * update script * fix * optimize setting * fix * compat * fix lint * add python version * fix ci * fix script * fix script * update script * fix script * fix script * fix script * fix script * fix script * fix script * update version * add ut * add lint * fix ci * fix folder * update readme && move doc template * update readme * refactor * refactor option * test * test * test * test * fix lint * rename * refactor * reset * fix script * update readme * fix lint * add comment * add api error * change go version * add close in body * update workflow * Go (#4) * feat: mv src to python * init go * optimize * support stream * optimize code * optimize code * add ut * add ut * add ci * update go version * update ci * fix mock server * update script * update script * fix makefile * update script * update script * fix * optimize setting * fix * compat * fix lint * add python version * fix ci * fix script * fix script * update script * fix script * fix script * fix script * fix script * fix script * fix script * update version * add ut * add lint * fix ci * fix folder * update readme && move doc template * update readme * refactor * refactor option * test * test * test * test * fix lint * rename * Multi language go (#3) * fix: dataset, trainer, evaluaton bug fix (#237) * fix * add more import on __init__.py in dataset package * cookbook update * refactor * reset * fix script * update readme * fix lint * add comment * add api error * change go version * add close in body * update workflow --------- Co-authored-by: Dobiichi-Origami <56953648+Dobiichi-Origami@users.noreply.github.com> --------- Co-authored-by: shikuan <shikuan@baidu.com> Co-authored-by: Dobiichi-Origami <56953648+Dobiichi-Origami@users.noreply.github.com> * fix workflow * add cache to actions * fix workflow * update workflow * update workflow * remove changelog * fix rtd * add go release action * add copyright --------- Co-authored-by: shikuan <shikuan@baidu.com> Co-authored-by: Dobiichi-Origami <56953648+Dobiichi-Origami@users.noreply.github.com>
- Loading branch information
1 parent
b658f26
commit 62049e3
Showing
196 changed files
with
2,322 additions
and
176 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,60 @@ | ||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
path: | ||
- "python/**" | ||
- "docs/**" | ||
- "README.md" | ||
workflow_dispatch: | ||
|
||
name: Docs | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./python | ||
|
||
env: | ||
RUFF_OUTPUT_FORMAT: github | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- 'ubuntu-latest' | ||
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 | ||
poetry lock | ||
- name: Get Poetry version | ||
run: poetry --version | ||
- name: Setup Python Cache | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
cache: "poetry" | ||
- name: Install deps | ||
run: | | ||
make install | ||
- name: Build docs | ||
run: make doc | ||
- name: Prepare artifact | ||
run: tar czvf /tmp/docs.tar.gz ./output/docs/_build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs | ||
path: /tmp/docs.tar.gz |
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,52 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Release docs | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: [Go Release, Python Release] | ||
types: | ||
- completed | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
docs: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install | ||
run: | | ||
pip3 install poetry | ||
make install | ||
- name: Build docs | ||
run: | | ||
make doc | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: './output/docs/_build/html' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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,65 @@ | ||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
path: | ||
- "go/**" | ||
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: 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 |
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,78 @@ | ||
name: Go Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
name: Release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- 'ubuntu-latest' | ||
go-version: [ '1.21.x' ] | ||
python-version: [ '3.11' ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Setup Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- name: Display version | ||
run: | | ||
go version | ||
python --version | ||
- name: Install latest version of Poetry | ||
if: steps.cache-poetry.outputs.cache-hit != 'true' | ||
run: | | ||
pip install poetry | ||
- name: Add Poetry to $PATH | ||
run: | | ||
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | ||
- name: Get Poetry version | ||
run: poetry --version | ||
- name: Install deps | ||
if: steps.cache-deps.cache-hit != 'true' | ||
run: | | ||
make install | ||
- 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 | ||
- name: Check version | ||
id: check-version | ||
run: | | ||
VERSION=$(cat go/qianfan/version.go|grep 'const Version ='|sed -r "s/.*\"v(.*)\"/\1/g") | ||
echo $VERSION | ||
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: ${{ format('Go v{0}', steps.check-version.outputs.version) }} | ||
token: ${{ secrets.QF_GITHUB_TOKEN }} | ||
draft: false | ||
generateReleaseNotes: true | ||
tag: ${{ format('go/qianfan/v{0}', steps.check-version.outputs.version) }} | ||
prerelease: ${{ contains(steps.check-version.outputs.version, 'rc') }} | ||
commit: main | ||
- name: Update Go module index | ||
env: | ||
GOPROXY: proxy.golang.org | ||
VERSION: ${{ steps.check-version.outputs.version }} | ||
run: | | ||
go list -m github.com/baidubce/bce-qianfan-sdk/go/qianfan@v$VERSION |
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
Oops, something went wrong.