Update README.md #37
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: Release | |
on: | |
push: | |
branches: | |
- main | |
- pre/* | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
run: pip install poetry | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-ansi | |
- name: Build the package | |
run: poetry build | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
run: pip install poetry | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-ansi | |
- name: Run Linting and Formatting Checks | |
run: | | |
poetry run ruff check brickllm tests | |
poetry run black --check brickllm tests | |
poetry run isort --check-only brickllm tests | |
# - name: Run Type Checking | |
# run: poetry run mypy brickllm tests | |
- name: Run Tests with Coverage | |
run: poetry run pytest --cov=brickllm --cov-report=xml tests/ | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.xml | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [build, test] | |
if: | | |
github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/pre/')) || | |
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && | |
(github.event.pull_request.base.ref == 'main' || startsWith(github.event.pull_request.base.ref, 'pre/')) | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
run: pip install poetry | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-ansi | |
- name: Semantic Release | |
uses: cycjimmy/[email protected] | |
with: | |
semantic_version: 23 | |
extra_plugins: | | |
semantic-release-pypi@3 | |
@semantic-release/git | |
@semantic-release/commit-analyzer@12 | |
@semantic-release/release-notes-generator@13 | |
@semantic-release/github@10 | |
@semantic-release/changelog@6 | |
conventional-changelog-conventionalcommits@7 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |