Update actions/download-artifact (https://github.com/advisories/GHSA-… #45
Workflow file for this run
This file contains hidden or 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
# From github.com/dfm/tinygp | |
name: merge-tests | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check_changes: | |
runs-on: ubuntu-latest | |
outputs: | |
run_job: ${{ steps.check_files.outputs.run_job }} | |
steps: | |
- name: Checkout PyVBMC | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: pyvbmc | |
- name: Check for modified files | |
id: check_files | |
run: | | |
cd ./pyvbmc | |
echo "=============== list modified files ===============" | |
git diff --name-only origin/main | |
echo "========== check paths of modified files ==========" | |
git diff --name-only origin/main > files.txt | |
echo "run_job=false" >> $GITHUB_OUTPUT | |
changes=false | |
while IFS= read -r file | |
do | |
echo $file | |
if [[ ($file != pyvbmc/*) && ($file != pyproject.toml) && ($file != setup.py) ]]; then | |
: | |
else | |
echo "Change in source files found, running tests." | |
echo "run_job=true" >> $GITHUB_OUTPUT | |
changes=true | |
break | |
fi | |
done < files.txt | |
if [ "$changes" = false ]; then | |
echo "No changes to source directory found, skipping tests." | |
fi | |
tests: | |
needs: check_changes | |
if: needs.check_changes.outputs.run_job == 'true' | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout PyVBMC | |
uses: actions/checkout@v3 | |
with: | |
path: pyvbmc | |
- name: Checkout GPyReg | |
uses: actions/checkout@v3 | |
with: | |
repository: acerbilab/gpyreg | |
path: gpyreg | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install PyVBMC | |
run: | | |
cd ./pyvbmc | |
python -m pip install -e . | |
- name: Install GPyReg | |
run: | | |
cd ./gpyreg | |
python -m pip install -e . | |
- name: Run tests | |
run: | | |
cd ./pyvbmc | |
python -m pytest --reruns=5 -x -vv |