Replace os.path with pathlib in filetype check (#422) #1748
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
name: test | |
on: | |
push: | |
branches: | |
- main | |
- '*.x' | |
tags: | |
- '*' | |
pull_request: | |
schedule: | |
# Weekly Monday 9AM build | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 9 * * 1' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
data: | |
name: retrieve current CRDS context | |
runs-on: ubuntu-latest | |
env: | |
OBSERVATORY: jwst | |
CRDS_PATH: /tmp/crds_cache | |
CRDS_SERVER_URL: https://jwst-crds.stsci.edu | |
steps: | |
- id: crds_context | |
run: > | |
echo "pmap=$( | |
curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}", null], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ | | |
python -c "import sys, json; print(json.load(sys.stdin)['result'])" | |
)" >> $GITHUB_OUTPUT | |
# Get default CRDS_CONTEXT without installing crds client | |
# See https://hst-crds.stsci.edu/static/users_guide/web_services.html#generic-request | |
- id: crds_path | |
run: echo "path=${{ env.CRDS_PATH }}" >> $GITHUB_OUTPUT | |
- id: crds_server | |
run: echo "url=${{ env.CRDS_SERVER_URL }}" >> $GITHUB_OUTPUT | |
outputs: | |
crds_context: ${{ steps.crds_context.outputs.pmap }} | |
crds_path: ${{ steps.crds_path.outputs.path }} | |
crds_server: ${{ steps.crds_server.outputs.url }} | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
with: | |
python-version: '3.12' | |
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
test: | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c0fde6f7e926df6ed7057255d29afa9c1ad5320 # v1.16.0 | |
needs: [ data ] | |
with: | |
setenv: | | |
CRDS_PATH: ${{ needs.data.outputs.crds_path }} | |
CRDS_SERVER_URL: ${{ needs.data.outputs.crds_server }} | |
CRDS_CLIENT_RETRY_COUNT: 3 | |
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 | |
cache-path: ${{ needs.data.outputs.crds_path }} | |
cache-key: crds-${{ needs.data.outputs.crds_context }} | |
envs: | | |
- linux: py311-xdist | |
- linux: py312-xdist | |
# `tox` does not currently use the `requires-python` versions | |
# defined in pyproject.toml. This means even if we set an upper limit | |
# for python in that file the `py3` below will try to use the newest | |
# python even if it's above that limit. | |
# If we don't support the latest stable python, update `py3` below | |
# to use only the latest supported version (matching what is set | |
# for `requires-python` in `pyproject.toml`) | |
- linux: py3-cov-xdist | |
coverage: codecov | |
- macos: py3-xdist | |
test_downstream: | |
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c0fde6f7e926df6ed7057255d29afa9c1ad5320 # v1.16.0 | |
needs: [ data ] | |
with: | |
setenv: | | |
CRDS_PATH: ${{ needs.data.outputs.crds_path }} | |
CRDS_SERVER_URL: ${{ needs.data.outputs.crds_server }} | |
CRDS_CLIENT_RETRY_COUNT: 3 | |
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 | |
cache-path: ${{ needs.data.outputs.crds_path }} | |
cache-key: crds-${{ needs.data.outputs.crds_context }} | |
envs: | | |
- linux: py311-jwst-cov-xdist |