Merge pull request #7 from giuseppeambrosio97/feat/mainghactions #7
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: RangedHeap CI CD | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
branches: | |
- develop | |
- main | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest] | |
python: ['3.9'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup and Install | |
uses: ./.github/actions/setup-and-install | |
with: | |
python-version: ${{ matrix.python }} | |
dependencies: '--with dev' | |
- name: Ruff check | |
working-directory: ./src/ranged_heap | |
run: poetry run ruff check | |
shell: bash | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest] | |
python: ['3.9'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup and Install | |
uses: ./.github/actions/setup-and-install | |
with: | |
python-version: ${{ matrix.python }} | |
dependencies: '--with test' | |
- name: Run tests | |
working-directory: ./src/ranged_heap | |
run: poetry run pytest | |
shell: bash | |
doc: | |
if: github.ref == 'refs/heads/main' | |
needs: [lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup and Install | |
uses: ./.github/actions/setup-and-install | |
with: | |
python-version: "3.9" | |
dependencies: '--with doc' | |
- name: Build documentation | |
run: poetry run mkdocs build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site |