Skip to content

Commit

Permalink
run tests after install
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Dec 6, 2023
1 parent d360444 commit 9d34846
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,27 @@ jobs:
with:
limit-access-to-actor: false

# test ability to download datasets in one job and use the cache in the others
- name: Cache Geant4 Datasets
if: matrix.python-version != '3.11'
id: cache-geant4-data
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/geant4-data
key: geant4-${{ matrix.geant4-version }}-data
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Move datasets
run: |
GEANT4_DATA_DIR=$(python -c "import geant4_python_application; print(geant4_python_application.datasets.data_dir)")
mkdir -p ${{ github.workspace }}/geant4-data $GEANT4_DATA_DIR
mv ${{ github.workspace }}/geant4-data $GEANT4_DATA_DIR
- name: Run tests
run: |
find ./tests -name "test_*.py" -exec python -m pytest -vv --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection|socket|resolve" {} \;
- name: Build Wheel
run: |
source ${{ github.workspace }}/geant4/bin/geant4.sh
Expand Down Expand Up @@ -243,25 +264,3 @@ jobs:
run: |
GEANT4_DATA_DIR=$(python -c "import geant4_python_application; print(geant4_python_application.datasets.data_dir)")
echo "GEANT4_DATA_DIR=${GEANT4_DATA_DIR}" >> $GITHUB_ENV
# test ability to download datasets in one job and use the cache in the others
- name: Cache Geant4 Datasets
if:
matrix.python-version != '3.11' || matrix.platform != 'ubuntu-latest'
id: cache-geant4-data
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/geant4-data
key: geant4-${{ matrix.geant4-version }}-data
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Move datasets
run: |
GEANT4_DATA_DIR=$(python -c "import geant4_python_application; print(geant4_python_application.datasets.data_dir)")
mkdir -p ${{ github.workspace }}/geant4-data $GEANT4_DATA_DIR
mv ${{ github.workspace }}/geant4-data $GEANT4_DATA_DIR
- name: Run tests
run: |
find ./tests -name "test_*.py" -exec python -m pytest -vv --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection|socket|resolve" {} \;

0 comments on commit 9d34846

Please sign in to comment.