Rename trading calendar update category to calendar update in release… #99
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: Build | |
on: | |
push: | |
branches: [ main ] | |
tags-ignore: | |
- 'v*' | |
jobs: | |
build: | |
name: 🏗️ Build | |
runs-on: ubuntu-latest | |
outputs: | |
next-version: ${{ steps.version.outputs.next-version }} | |
steps: | |
- name: Checkout repository ⚙️ | |
uses: actions/checkout@v4 | |
- name: Get version number 🔢 | |
id: get-version | |
uses: release-drafter/release-drafter@v6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Store next version 🔢 | |
id: version | |
run: | | |
echo "next-version=${{ steps.get-version.outputs.tag_name }}" | cut -c -13,15- >> $GITHUB_OUTPUT | |
- name: Print next version 🔢 | |
run: | | |
echo "Next version: ${{ steps.version.outputs.next-version }}" | |
- name: Setup Python ⚙️ | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' # caching pip dependencies | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install dependencies ⚙️ | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build and test 🏗️ | |
run: | | |
pip install httpx pytest pytest-cov coverage | |
pytest -v --doctest-modules --junitxml=junit/test-results.xml --cov=trading_calendar --cov-report=xml --cov-report=html | |
- name: Upload coverage reports | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
documentation: | |
name: 📚 Publish API doc | |
needs: [build] | |
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.event_name != 'schedule' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository ⚙️ | |
uses: actions/checkout@v4 | |
- name: Generate OpenAPI specification 📝 | |
uses: column-st/[email protected] | |
with: | |
moduleDir: trading_calendar | |
outputExtension: json | |
- name: Generate API doc 📝 | |
uses: seeebiii/redoc-cli-github-action@v10 | |
with: | |
args: 'bundle openapi.json -o docs/api-doc/index.html' | |
- name: Deploy API doc 📚 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: docs/api-doc | |
target-folder: api-doc/snapshot | |
commit-message: Publishing ${{ needs.build.outputs.next-version }} API doc | |
clean: true | |
dry-run: false |