mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
ci: change ci yml (#146)
* change ci yml * add PULL_REQUEST_TEMPLATE * change ci yml * change ci yml * Update .github/workflows/release.yml * Update .github/workflows/release.yml * Update .github/workflows/release.yml --------- Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
[bumpversion]
|
||||||
|
current_version = 0.0.1
|
||||||
|
commit = True
|
||||||
|
tag = True
|
||||||
|
|
||||||
|
[bumpversion:file:pyproject.toml]
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<!--- Thank you for submitting a Pull Request! In order to make our work smoother, please make sure your Pull Request meets the following requirements: 1. Provide a general summary of your changes in the Title above; 2. Add appropriate prefixes to titles, such as `build:`, `chore:`, `ci:`, `deps:`, `doc`, `docs`, `feat`, `fix`, `perf`, `ref`, `refactor`, `revert`, `style`, `test`, `tests`. -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
<!--- Describe your changes in detail -->
|
||||||
|
|
||||||
|
## Motivation and Context
|
||||||
|
<!--- Are there any related issues? If so, please put the link here. -->
|
||||||
|
<!--- Why is this change required? What problem does it solve? -->
|
||||||
|
|
||||||
|
## How Has This Been Tested?
|
||||||
|
<!--- Put an `x` in all the boxes that apply: --->
|
||||||
|
- [ ] Pass the test by running: `pytest qlib/tests/test_all_pipeline.py` under upper directory of `qlib`.
|
||||||
|
- [ ] If you are adding a new feature, test on your own test scripts.
|
||||||
|
|
||||||
|
<!--- **ATTENTION**: If you are adding a new feature, please make sure your codes are **correctly tested**. If our test scripts do not cover your cases, please provide your own test scripts under the `tests` folder and test them. More information about test scripts can be found [here](https://docs.python.org/3/library/unittest.html#basic-example), or you could refer to those we provide under the `tests` folder. -->
|
||||||
|
|
||||||
|
## Screenshots of Test Results (if appropriate):
|
||||||
|
1. Pipeline test:
|
||||||
|
2. Your own tests:
|
||||||
|
|
||||||
|
## Types of changes
|
||||||
|
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||||
|
- [ ] Fix bugs
|
||||||
|
- [ ] Add new feature
|
||||||
|
- [ ] Update documentation
|
||||||
@@ -19,17 +19,7 @@ jobs:
|
|||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- run: env | sort
|
- run: env | sort
|
||||||
- run: make dev
|
- run: make dev
|
||||||
- env:
|
- name: lint test docs and build
|
||||||
# Two environment variables here can cause sphinx to fail to build in ci.
|
|
||||||
# CHAT_MAX_TOKENS: ${{ secrets.CHAT_MAX_TOKENS }}
|
|
||||||
# CHAT_TEMPERATURE: ${{ secrets.CHAT_TEMPERATURE }}
|
|
||||||
CHAT_AZURE_API_BASE: ${{ secrets.CHAT_AZURE_API_BASE }}
|
|
||||||
CHAT_AZURE_API_VERSION: ${{ secrets.CHAT_AZURE_API_VERSION }}
|
|
||||||
CHAT_MODEL: ${{ secrets.CHAT_MODEL }}
|
|
||||||
EMBEDDING_AZURE_API_BASE: ${{ secrets.CHAT_AZURE_API_BASE }}
|
|
||||||
EMBEDDING_AZURE_API_VERSION: ${{ secrets.CHAT_AZURE_API_VERSION }}
|
|
||||||
EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }}
|
|
||||||
name: lint test docs and build
|
|
||||||
run: make lint docs-gen # test docs build
|
run: make lint docs-gen # test docs build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
concurrency:
|
||||||
|
cancel-in-progress: true
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
jobs:
|
||||||
|
lint-title:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check PR Title for Conventional Commit Format
|
||||||
|
run: |
|
||||||
|
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|deps|doc|docs|feat|fix|perf|ref|refactor|revert|style|test|tests)(\(\w+\))?!?:\s.*'; then
|
||||||
|
echo 'The title does not conform to the Conventional Commit.'
|
||||||
|
echo 'Please refer to "https://www.conventionalcommits.org/"'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
name: Lint pull request title
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
@@ -1,23 +1,15 @@
|
|||||||
|
name: Release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
jobs:
|
jobs:
|
||||||
package:
|
release:
|
||||||
needs: release
|
permissions:
|
||||||
runs-on: ubuntu-latest
|
contents: write
|
||||||
steps:
|
pull-requests: read
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
cache: pip
|
|
||||||
python-version: '3.8'
|
|
||||||
- run: env | sort
|
|
||||||
- run: make dev-package
|
|
||||||
- run: make build
|
|
||||||
- env:
|
|
||||||
TWINE_NON_INTERACTIVE: true
|
|
||||||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
|
|
||||||
TWINE_USERNAME: ${{ vars.TWINE_USERNAME != '' && vars.TWINE_USERNAME || '__token__' }}
|
|
||||||
run: make upload
|
|
||||||
pages-build:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -27,65 +19,53 @@ jobs:
|
|||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
cache: pip
|
cache: pip
|
||||||
python-version: '3.8'
|
python-version: '3.10'
|
||||||
- run: env | sort
|
- name: Install dependencies
|
||||||
- run: make dev-docs
|
run: |
|
||||||
- run: make docs
|
python -m pip install --upgrade pip
|
||||||
- name: Upload changelog
|
pip install setuptools wheel twine bump2version git-changelog # better-exceptions(optional for debug)
|
||||||
uses: actions/upload-artifact@v4
|
- name: Bump version
|
||||||
with:
|
run: |
|
||||||
name: changelog
|
git config --global user.name 'github-actions[bot]'
|
||||||
path: docs/changelog.md
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
- name: Upload pages artifact
|
bump2version patch
|
||||||
uses: actions/upload-pages-artifact@v3
|
NEW_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
|
||||||
with:
|
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
|
||||||
path: public
|
echo "New version: $NEW_VERSION"
|
||||||
pages-deploy:
|
- name: Push changes
|
||||||
needs: release
|
env:
|
||||||
permissions:
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
id-token: write
|
run: |
|
||||||
pages: write
|
git push --follow-tags
|
||||||
runs-on: ubuntu-latest
|
- name: Generate changelog
|
||||||
steps:
|
run: |
|
||||||
- id: deployment
|
make changelog
|
||||||
name: Deploy to GitHub Pages
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
release:
|
|
||||||
needs: pages-build
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install git-changelog using pipx
|
|
||||||
run: pipx install git-changelog
|
|
||||||
- name: Remove changelog to avoid file already exists error
|
|
||||||
run: rm -v docs/changelog.md
|
|
||||||
- name: Download changelog
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: changelog
|
|
||||||
path: docs/
|
|
||||||
- name: Prepare release notes
|
- name: Prepare release notes
|
||||||
run: make release-notes > release-notes.md
|
run: make release-notes > release-notes.md
|
||||||
- id: prerelease
|
|
||||||
name: Determine prerelease
|
|
||||||
run: |
|
|
||||||
if [[ "${{ github.ref }}" =~ (a|b|rc)(0|[1-9][0-9]*)?$ ]]; then
|
|
||||||
echo "is_prerelease=true" > $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "is_prerelease=false" > $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
- name: Create GitHub release
|
- name: Create GitHub release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ env.new_version }}
|
||||||
|
release_name: Release ${{ env.new_version }}
|
||||||
body_path: release-notes.md
|
body_path: release-notes.md
|
||||||
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
|
prerelease: false
|
||||||
name: Release
|
# package:
|
||||||
on:
|
# needs: release
|
||||||
push:
|
# runs-on: ubuntu-latest
|
||||||
tags:
|
# steps:
|
||||||
- v?[0-9]+.[0-9]+.[0-9]+
|
# - uses: actions/checkout@v4
|
||||||
- v?[0-9]+.[0-9]+.[0-9]+-?a[0-9]*
|
# - name: Set up Python
|
||||||
- v?[0-9]+.[0-9]+.[0-9]+-?b[0-9]*
|
# uses: actions/setup-python@v5
|
||||||
- v?[0-9]+.[0-9]+.[0-9]+-?rc[0-9]*
|
# with:
|
||||||
|
# cache: pip
|
||||||
|
# python-version: '3.10'
|
||||||
|
# - run: env | sort
|
||||||
|
# - run: make dev
|
||||||
|
# - run: make build
|
||||||
|
# - env:
|
||||||
|
# TWINE_USERNAME: __token__
|
||||||
|
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
# run: |
|
||||||
|
# make upload
|
||||||
|
|||||||
@@ -169,13 +169,19 @@ docs-autobuild:
|
|||||||
--watch rdagent
|
--watch rdagent
|
||||||
|
|
||||||
# Generate changelog from git commits.
|
# Generate changelog from git commits.
|
||||||
|
# The -c and -s arguments should match
|
||||||
|
# If -c uses Basic (default, inherits from base class), -s optional argument: # If -c uses conventional (inherits from base class), -s optional parameter: add,fix,change,remove,merge,doc
|
||||||
|
# If -c uses conventional (inherits from base class), -s is optional: build,chore,ci,deps,doc,docs,feat,fix,perf,ref,refactor,revert,style,test,tests
|
||||||
|
# If -c uses angular (inherits from conventional), -s optional argument: build,chore,ci,deps,doc,docs,feat,fix,perf,ref,refactor,revert,style,test,tests
|
||||||
# NOTE(xuan.hu): Need to be run before document generation to take effect.
|
# NOTE(xuan.hu): Need to be run before document generation to take effect.
|
||||||
|
# $(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
|
||||||
changelog:
|
changelog:
|
||||||
@if wget -q --spider $(CHANGELOG_URL); then \
|
@if wget -q --spider $(CHANGELOG_URL); then \
|
||||||
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
|
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
|
||||||
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
|
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
|
||||||
fi
|
fi
|
||||||
$(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
|
$(PIPRUN) LATEST_TAG=$$(git tag --sort=-creatordate | head -n 1); \
|
||||||
|
git-changelog --bump $$LATEST_TAG -Tio docs/changelog.md -c conventional -s build,chore,ci,deps,doc,docs,feat,fix,perf,ref,refactor,revert,style,test,tests
|
||||||
|
|
||||||
# Generate release notes from changelog.
|
# Generate release notes from changelog.
|
||||||
release-notes:
|
release-notes:
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
<!-- insertion marker -->
|
||||||
+3
-5
@@ -4,7 +4,6 @@ requires = [
|
|||||||
"setuptools",
|
"setuptools",
|
||||||
"setuptools-scm",
|
"setuptools-scm",
|
||||||
]
|
]
|
||||||
root = "rdagent"
|
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
authors = [
|
authors = [
|
||||||
@@ -16,23 +15,22 @@ classifiers = [
|
|||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.8",
|
|
||||||
"Programming Language :: Python :: 3.9",
|
|
||||||
]
|
]
|
||||||
description = "Research & Development Agent"
|
description = "Research & Development Agent"
|
||||||
dynamic = [
|
dynamic = [
|
||||||
"dependencies",
|
"dependencies",
|
||||||
"optional-dependencies",
|
"optional-dependencies",
|
||||||
"version",
|
|
||||||
]
|
]
|
||||||
keywords = [
|
keywords = [
|
||||||
"Autonomous Agents",
|
"Autonomous Agents",
|
||||||
"Large Language Models",
|
"Large Language Models",
|
||||||
"Research and Development",
|
"Research and Development",
|
||||||
]
|
]
|
||||||
|
license = {text = "MIT License"}
|
||||||
name = "rdagent"
|
name = "rdagent"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.10"
|
||||||
|
version = "v0.0.1"
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
homepage = "https://github.com/microsoft/RD-Agent/"
|
homepage = "https://github.com/microsoft/RD-Agent/"
|
||||||
|
|||||||
Reference in New Issue
Block a user