mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 15:37:44 +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 }}
|
||||
- run: env | sort
|
||||
- run: make dev
|
||||
- env:
|
||||
# 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
|
||||
- name: lint test docs and build
|
||||
run: make lint docs-gen # test docs build
|
||||
strategy:
|
||||
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:
|
||||
package:
|
||||
needs: release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- 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:
|
||||
release:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -27,65 +19,53 @@ jobs:
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
cache: pip
|
||||
python-version: '3.8'
|
||||
- run: env | sort
|
||||
- run: make dev-docs
|
||||
- run: make docs
|
||||
- name: Upload changelog
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: changelog
|
||||
path: docs/changelog.md
|
||||
- name: Upload pages artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: public
|
||||
pages-deploy:
|
||||
needs: release
|
||||
permissions:
|
||||
id-token: write
|
||||
pages: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: deployment
|
||||
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/
|
||||
python-version: '3.10'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine bump2version git-changelog # better-exceptions(optional for debug)
|
||||
- name: Bump version
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
bump2version patch
|
||||
NEW_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
|
||||
echo "New version: $NEW_VERSION"
|
||||
- name: Push changes
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git push --follow-tags
|
||||
- name: Generate changelog
|
||||
run: |
|
||||
make changelog
|
||||
- name: Prepare release notes
|
||||
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
|
||||
uses: softprops/action-gh-release@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ env.new_version }}
|
||||
release_name: Release ${{ env.new_version }}
|
||||
body_path: release-notes.md
|
||||
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v?[0-9]+.[0-9]+.[0-9]+
|
||||
- v?[0-9]+.[0-9]+.[0-9]+-?a[0-9]*
|
||||
- v?[0-9]+.[0-9]+.[0-9]+-?b[0-9]*
|
||||
- v?[0-9]+.[0-9]+.[0-9]+-?rc[0-9]*
|
||||
prerelease: false
|
||||
# package:
|
||||
# needs: release
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Set up Python
|
||||
# uses: actions/setup-python@v5
|
||||
# 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
|
||||
|
||||
# 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.
|
||||
# $(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
|
||||
changelog:
|
||||
@if wget -q --spider $(CHANGELOG_URL); then \
|
||||
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
|
||||
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
|
||||
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.
|
||||
release-notes:
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
<!-- insertion marker -->
|
||||
+3
-5
@@ -4,7 +4,6 @@ requires = [
|
||||
"setuptools",
|
||||
"setuptools-scm",
|
||||
]
|
||||
root = "rdagent"
|
||||
|
||||
[project]
|
||||
authors = [
|
||||
@@ -16,23 +15,22 @@ classifiers = [
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
]
|
||||
description = "Research & Development Agent"
|
||||
dynamic = [
|
||||
"dependencies",
|
||||
"optional-dependencies",
|
||||
"version",
|
||||
]
|
||||
keywords = [
|
||||
"Autonomous Agents",
|
||||
"Large Language Models",
|
||||
"Research and Development",
|
||||
]
|
||||
license = {text = "MIT License"}
|
||||
name = "rdagent"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8"
|
||||
requires-python = ">=3.10"
|
||||
version = "v0.0.1"
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/microsoft/RD-Agent/"
|
||||
|
||||
Reference in New Issue
Block a user