Skip to content

Feature/535 stratification diag #427

Feature/535 stratification diag

Feature/535 stratification diag #427

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 "[email protected]"
git config --global author.email "[email protected]"
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