-
Notifications
You must be signed in to change notification settings - Fork 11
40 lines (37 loc) · 1.42 KB
/
unit_test_contents.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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