diff options
Diffstat (limited to '.github/workflows/codspeed.yml')
-rw-r--r-- | .github/workflows/codspeed.yml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml new file mode 100644 index 0000000..fcc7ed3 --- /dev/null +++ b/.github/workflows/codspeed.yml @@ -0,0 +1,52 @@ +name: codspeed + +on: + push: + branches: + - "master" + pull_request: + # `workflow_dispatch` allows CodSpeed to trigger backtest + # performance analysis in order to generate initial data. + workflow_dispatch: + +jobs: + benchmarks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: "3.9" + + - name: Get full Python version + id: full-python-version + run: | + echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") + + - name: Install poetry + run: | + curl -fsS https://install.python-poetry.org | python - -y + + - name: Update PATH + if: ${{ matrix.os != 'Windows' }} + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: Configure poetry + run: poetry config virtualenvs.create false + + - name: Install dependencies + run: poetry install --only test --only benchmark --only build -vvv --no-root + + - name: Install project + run: poetry install --only test --only benchmark --only build -vvv --no-root + + - name: Install pendulum and check extensions + run: | + poetry run pip install -e . -vvv + python -c 'import pendulum._pendulum' + + - name: Run benchmarks + uses: CodSpeedHQ/action@v1 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: pytest tests/ --codspeed |