Skip to content

Commit

Permalink
Change flags from those recommend by Boris to those recommended by Nat.
Browse files Browse the repository at this point in the history
  • Loading branch information
fyellin committed Nov 3, 2024
1 parent 16df053 commit 0bd34d9
Showing 1 changed file with 4 additions and 80 deletions.
84 changes: 4 additions & 80 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ run-name: "Run Tests: ${{ github.ref_type }} ${{ github.ref_name }} by ${{ githu
on:
workflow_dispatch:
pull_request:
branches: [ main ]
branches: [ main test]
push:
branches: [ main ]
branches: [ main test]
schedule:
- cron: "20 11 * * 0"

Expand All @@ -31,83 +31,7 @@ jobs:
brew update
brew install swig
- 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 -r requirements.txt
- name: Cache CSPICE source code
uses: actions/cache@v3
env:
cache-name: cspice-source-code
with:
path: cspice
# If setup.py is modified, we want to invalidate the cache. It means that there
# has been some change to the build process (a new Spice version??) and we want
# to make sure new sources are pulled.
key: ${{ matrix.os }}-${{ runner.arch }}-${{ env.cache-name }}-${{ hashFiles('setup.py') }}

- name: Generate cspyce
- name: Determine swig version
run: |
python setup.py generate
- name: Determine compiler version for non-Windows
if: matrix.os != 'windows-latest'
run: |
gcc --version > compiler-version.txt
cat compiler-version.txt
- name: Determine compiler version for Windows
if: matrix.os == 'windows-latest'
# We ask Python what it uses as the compiler. I can't find anything simpler.
run: |
python3 -c 'import distutils.ccompiler as cc; x = cc.new_compiler(); x.initialize(); print(x.cc)' > compiler-version.txt
cat compiler-version.txt
- name: Cache libraries
id: cache-libraries
uses: actions/cache@v3
env:
cache-name: cspice-libraries
with:
path: build/
# We need to rebuild the cspice library if the source files have changed,
# if there is some change in the build process, or if the compiler version
# has changed.
key: ${{ matrix.os }}-${{ runner.arch }}-${{ matrix.python-version }}-${{ env.cache-name }}-${{ hashFiles('setup.py', 'compiler-version.txt', 'cspice/**/*') }}
swig -version
- name: Compile C libraries
if: ${{ steps.cache-libraries.outputs.cache-hit != 'true' }}
run: |
python setup.py build_clib
- name: Build extensions
run: |
python setup.py build_ext --inplace
- name: Install cspyce
run: |
python -m pip install .
# We want to test operation with NumPy 1.x without needing a whole new matrix,
# so we arbitrarily choose that 3.10 should use 1.x instead of 2.x
- name: Maybe revert to NumPy 1.26
if: matrix.python-version == '3.10'
run: |
python -m pip uninstall -y numpy
python -m pip install numpy==1.26.4
- name: Test with coverage
run: |
pytest -v -rA --cov=./ --cov-report=xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

0 comments on commit 0bd34d9

Please sign in to comment.