File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : build-and-test
2+ description : |
3+ Set up Python and run the build and test steps.
4+
5+ runs :
6+ using : composite
7+ steps :
8+ - name : Set up Python
9+ uses : ./.github/actions/setup-python
10+ # TODO: move dependencies to a separate file (e.g. a requirements.txt file)
11+ - name : Install dependencies
12+ shell : bash
13+ run : |
14+ python -m pip install pytest mock build
15+ - name : Run build
16+ shell : bash
17+ run : python -m build
18+ - name : Show dist files
19+ shell : bash
20+ run : |
21+ echo "Dist files:"
22+ ls -lh dist/
23+ - name : Run pytest
24+ shell : bash
25+ run : |
26+ python -m pip install -e .
27+ pytest
Original file line number Diff line number Diff line change 1+ name : build-and-test
2+ description : |
3+ This action lets the Python version for CI be specified in a single place.
4+
5+ runs :
6+ using : composite
7+ steps :
8+ - name : Set up Python
9+ uses : actions/setup-python@v5
10+ with :
11+ python-version : " 3.10"
12+ cache : pip
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # This workflow builds and tests code that is pushed to the `master` branch.
2+
3+ name : merge
4+
5+ on :
6+ push :
7+ branches :
8+ - master
9+
10+ jobs :
11+ merge :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout repo
15+ uses : actions/checkout@v4
16+ with :
17+ fetch-tags : true
18+ fetch-depth : 0
19+ - name : Build and test
20+ uses : ./.github/actions/build-and-test
Original file line number Diff line number Diff line change 1+ # This workflow builds and tests code in pull requests.
2+
3+ name : pr
4+
5+ on : pull_request
6+
7+ jobs :
8+ pr :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout repo
12+ uses : actions/checkout@v4
13+ with :
14+ fetch-tags : true
15+ fetch-depth : 0
16+ - name : Build and test
17+ uses : ./.github/actions/build-and-test
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # This workflow initiates a release of the project.
2+
3+ name : release
4+
5+ # on:
6+ # workflow_dispatch:
7+ # inputs:
8+ # version:
9+ # description: Release version (e.g. `v0.4.5`)
10+ # type: string
11+ # required: true
12+
13+ on : pull_request
14+
15+ jobs :
16+ release :
17+ permissions :
18+ # `contents: write` is required to create tags and create releases
19+ contents : write
20+ runs-on : ubuntu-latest
21+ env :
22+ # RELEASE_VERSION: ${{ inputs.version }}
23+ RELEASE_VERSION : v0.4.5
24+ steps :
25+ - name : Checkout repo
26+ uses : actions/checkout@v4
27+ with :
28+ fetch-tags : true
29+ fetch-depth : 0
30+ - name : Create local lightweight tag
31+ run : git tag "${RELEASE_VERSION}"
32+ - name : Build and test
33+ uses : ./.github/actions/build-and-test
34+ # - name: Push tag
35+ # run: git push origin "${RELEASE_VERSION}"
36+ # - name: Create release from tag
37+ # env:
38+ # GH_TOKEN: ${{ github.token }}
39+ # run: |
40+ # gh api \
41+ # --method POST \
42+ # "/repos/${GITHUB_REPOSITORY}/releases" \
43+ # -f "tag_name=${RELEASE_VERSION}" \
44+ # -f "name=${RELEASE_VERSION}" \
45+ # -F "draft=false" \
46+ # -F "prerelease=false" \
47+ # -F "generate_release_notes=true"
48+ # - name: Publish package distributions to PyPI
49+ # # TODO: setup attestations and trusted publishing.
50+ # uses: pypa/gh-action-pypi-publish@release/v1
51+ # with:
52+ # # attestations require trusted publishing which isn't setup yet
53+ # attestations: false
54+ # password: ${{ secrets.PYPI_TOKEN }}
You can’t perform that action at this time.
0 commit comments