From 7f2dfce83d186d5df5c89f432ba12b8427245f1b Mon Sep 17 00:00:00 2001 From: Manuel-Knepper Date: Wed, 6 May 2026 11:38:46 +0200 Subject: [PATCH] added test.yml for testing workflow --- .github/workflows/test.yml | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..650d76e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,88 @@ +name: Test + +on: + push: + branches: # on all branches except `typos` + - '**' + - '!typos' + paths-ignore: + - 'docs/**' + - 'examples/**' + - 'data/**' + - '.git*' + - 'README.md' + pull_request: + branches: + - '**' + schedule: # Every Monday at 04:00 UTC + - cron: '0 4 * * 1' + +jobs: + caching: + strategy: + matrix: + python-version: ["3.12"] + os: [ ubuntu-latest ] + fail-fast: false + env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + + defaults: + run: + shell: bash -elo pipefail {0} + + name: Cache for ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + + - name: Get week number + run: echo "WEEK=$(date +'%V')" >> $GITHUB_ENV + + - name: Set up Python ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v2 + with: + create-args: python=${{ matrix.python-version }} + environment-file: environment-dev.yml + cache-environment: true + cache-environment-key: W${{ env.WEEK }} + + run-tests: + needs: caching + strategy: + matrix: + python-version: ["3.12"] + os: [ ubuntu-latest ] + submodule: + - { + name: "Functions", + pytest_args: "tests/test_functions.py" } + fail-fast: false + + name: ${{ matrix.submodule.name }} (${{ matrix.python-version }} on ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + defaults: + run: + shell: bash -el {0} + + steps: + - uses: actions/checkout@v6 + + - name: Get week number + run: echo "WEEK=$(date +'%V')" >> $GITHUB_ENV + + - name: Set up Python ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v2 + with: + create-args: python=${{ matrix.python-version }} + environment-file: environment-dev.yml + cache-environment: true + cache-environment-key: W${{ env.WEEK }} + + - name: Install fixbikenet + run: pip install --no-build-isolation --no-deps -e . + + - name: "Run tests ${{ matrix.submodule.name }}" + run: | + pytest ${{ matrix.submodule.pytest_args }}