Update build script #26
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: | |
- uses: actions/checkout@v4 | |
- 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 codecov | |
pytest -v --doctest-modules --junitxml=junit/test-results.xml --cov=trading_calendar --cov-report=xml --cov-report=html | |
- name: Upload coverage reports | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- 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 }}" |