diff --git a/.github/workflows/monthly-api-tests.yaml b/.github/workflows/monthly-api-tests.yaml new file mode 100644 index 0000000..a07871d --- /dev/null +++ b/.github/workflows/monthly-api-tests.yaml @@ -0,0 +1,34 @@ +name: monthly API response check +on: + push: + branches: + - monthly-api-checks + schedule: + - cron: '5 9 15 * *' +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + WCKEY: ${{ secrets.WC_KEY }} + WCSECRET: ${{ secrets.WC_SECRET }} + WCSCOPES: "WorldCatMetadataAPI" +jobs: + monthly-run: + name: Run monthly API response check + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version}} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version}} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r dev-requirements.txt + + - name: Run monthly live tests + run: | + pytest -m "monthly_check" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8db391e..0b3c99f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,7 @@ markers = [ "webtest: mark a test hitting live endpoints", "holdings: mark holdings live endpoint tests", "http_code: use to pass returned http code to 'mock_session_response' fixture that mocks 'requests.Session.send' method", + "monthly_check: mark a test that should be run with monthly API response check", ] [tool.coverage.run]