Skip to content

Feature/535 stratification diag #428

Feature/535 stratification diag

Feature/535 stratification diag #428

name: Generate and commit unit test contents file.
on: pull_request
jobs:
generate-test-contents:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} for running python script.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Generate contents.
run: |
pip install .
mkdir -p example_files
sudo apt-get update
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
pip install xarray[complete]
pip install aiohttp requests
python unit_testing/generate_unit_test_contents.py
- name: Commit changes
run: |
git config --global user.name "ContentsBot"
git config --global author.name "ContentsBot"
git config --global user.email "bodcsoft@bodc.ac.uk"
git config --global author.email "bodcsoft@bodc.ac.uk"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git checkout $GITHUB_HEAD_REF
git pull
git diff-index --quiet $GITHUB_HEAD_REF || git commit -am "Commit generated unit test contents."
git push origin $GITHUB_HEAD_REF