Add build and test in PR. #17
Workflow file for this run
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: Checks when a PR is made to main. | |
on: | |
pull_request: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
# The type of runner that the job will run on | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-minor-version: ["9", "10", "11", "12"] | |
runs-on: ${{ matrix.os }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.${{ matrix.python-minor-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.${{ matrix.python-minor-version }} | |
- name: Build and test | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip install maturin | |
make install-dev | |
make test | |
version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install requirements | |
run: python -m pip install towncrier | |
- name: Check Towncrier | |
shell: bash | |
run: | | |
# Fetch the pull request' base branch so towncrier will be able to | |
# compare the current branch with the base branch. | |
# Source: https://github.com/actions/checkout/#fetch-all-branches. | |
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH} | |
towncrier check --compare-with origin/${BASE_BRANCH} | |
env: | |
BASE_BRANCH: ${{ github.base_ref }} |