From 3291b0749de46a61e5f8ddda0757e4165268666c Mon Sep 17 00:00:00 2001 From: JaskRendix Date: Fri, 26 Sep 2025 11:52:28 +0200 Subject: [PATCH] workflow --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++ .github/workflows/test.yml | 25 ++++++++++------------- .github/workflows/test_trigger.yml | 9 +++++++++ README.rst | 2 +- 4 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test_trigger.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2efb954 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish Package + +on: + push: + branches: + - development + +jobs: + test: + uses: ./.github/workflows/test.yml + + publish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.9' + + - name: Build distribution + run: | + python -m pip install --upgrade build + python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e3efd5..cfd27dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,29 +1,24 @@ -name: Test +name: Run Tests on: - push + workflow_call: jobs: - - build: - name: Test + test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: Checkout code + uses: actions/checkout@v5 + - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: - python-version: 3.9 + python-version: '3.9' + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt + - name: Run tests run: python -m unittest discover -b --start-directory ./tests - - name: build dist - run: python3 -m pip install --upgrade build && python3 -m build - - name: Publish package - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test_trigger.yml b/.github/workflows/test_trigger.yml new file mode 100644 index 0000000..8aeb664 --- /dev/null +++ b/.github/workflows/test_trigger.yml @@ -0,0 +1,9 @@ +name: Test Trigger + +on: + push: + pull_request: + +jobs: + test: + uses: ./.github/workflows/test.yml diff --git a/README.rst b/README.rst index dbae11c..7f7b90f 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ Example race task with open('example.igc', 'r') as f: parsed_igc_file = Reader().read(f) - # example.igc comes from soaringspot and contains task inforamtion + # example.igc comes from soaringspot and contains task information task, _, _ = get_info_from_comment_lines(parsed_igc_file) _, trace = parsed_igc_file['fix_records']