-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated pyproject.toml Added github workflows.
- Loading branch information
Showing
5 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Code CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
dist: | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build sdist and wheel | ||
run: pipx run build | ||
|
||
- name: Upload sdist and wheel as artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
pypi: | ||
# upload to PyPI and make a release on every tag | ||
if: github.ref_type == 'tag' | ||
needs: [dist] | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
# this permission is mandatory for trusted publishing To PyPI | ||
id-token: write | ||
# Specify the GitHub Environment to publish to | ||
environment: release | ||
|
||
steps: | ||
# download sdist and wheel from dist job | ||
- uses: actions/download-artifact@v3 | ||
|
||
# publish to PyPI using trusted publishing | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
# Deduplicate jobs from pull requests and branch pushes within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip | ||
|
||
- name: Install dependencies | ||
run: python -m pip install . | ||
|
||
- name: Install pytest | ||
run: python -m pip install pytest | ||
|
||
- name: Dans_Diffraction Version | ||
run: python -c "import Dans_Diffraction; print(Dans_Diffraction.module_info())" | ||
|
||
- name: Run tests | ||
run: python -m pytest |
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
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
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