Skip to content

Commit

Permalink
Update CI scripts to use pdm
Browse files Browse the repository at this point in the history
  • Loading branch information
moeyensj committed Oct 8, 2024
1 parent 0ee4d18 commit cbb41f7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 82 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/conda-build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,9 @@ jobs:
activate-environment: "thor"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies (excluding adam_core and quivr since they are not available via conda)
run: |
tail +3 requirements.txt > requirements_conda.txt
conda install -c defaults -c conda-forge -c astropy -c moeyensj --file requirements_conda.txt --yes
- name: Update OBSCODE.dat
run: |
cd $CONDA_PREFIX/share/oorb
curl https://www.minorplanetcenter.net/iau/lists/ObsCodes.html -o ObsCodes.html
sed -e '2d' ObsCodes.html | grep -v "<" > OBSCODE.dat
rm -f ObsCodes.html
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat
- name: Install adam_core and quivr
run: |
pip install adam-core@git+https://github.com/B612-Asteroid-Institute/adam_core@main
pip install quivr@git+https://github.com/moeyensj/quivr@concatenate-empty-attributes
- name: Build and install
run: pip install . --no-deps
run: pip install .[dev]
- name: Lint
run: pre-commit run --all-files
run: pdm lint
- name: Test
run: pytest . --cov
run: pdm test
4 changes: 2 additions & 2 deletions .github/workflows/docker-build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
- name: Build
run: docker build --load -t thor:$IMAGE_TAG .
- name: Lint
run: docker run -i thor:$IMAGE_TAG pre-commit run --all-files
run: docker run -i thor:$IMAGE_TAG pdm lint
- name: Test
run: docker run -i thor:$IMAGE_TAG pytest . --cov
run: docker run -i thor:$IMAGE_TAG pdm test
22 changes: 6 additions & 16 deletions .github/workflows/pip-build-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,13 @@ jobs:
uses: actions/checkout@v4
- name: Get git tags
run: git fetch --prune --unshallow --tags
- name: Set up miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "thor"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install openorb using conda
run: conda install -c defaults -c conda-forge openorb --yes
- name: Update OBSCODE.dat
run: |
cd $CONDA_PREFIX/share/oorb && ./updateOBSCODE
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Build and install
run: pip install .[tests]
- name: Install Dependencies
run: |
pip install pip --upgrade
pip install ".[dev]"
- name: Integration Tests
run: pytest . -m "integration"
run: pdm test -k integration
33 changes: 11 additions & 22 deletions .github/workflows/pip-build-lint-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,21 @@ jobs:
uses: actions/checkout@v4
- name: Get git tags
run: git fetch --prune --unshallow --tags
- name: Set up miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "thor"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install openorb using conda
run: conda install -c defaults -c conda-forge openorb --yes
- name: Update OBSCODE.dat
run: |
cd $CONDA_PREFIX/share/oorb
curl https://www.minorplanetcenter.net/iau/lists/ObsCodes.html -o ObsCodes.html
sed -e '2d' ObsCodes.html | grep -v "<" > OBSCODE.dat
rm -f ObsCodes.html
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Build and install
run: pip install .[tests]
- name: Install Dependencies
run: |
pip install pip --upgrade
pip install ".[dev]"
- name: Lint
run: pre-commit run --all-files
- name: Test
run: pytest . --cov --cov-report xml
- name: Coverage
run: pdm run lint
# - name: Type check
# run: pdm run typecheck
- name: Test with coverage
run: pdm run coverage
- name: Coverage Report
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
Expand Down
24 changes: 0 additions & 24 deletions requirements.txt

This file was deleted.

0 comments on commit cbb41f7

Please sign in to comment.