Testing and deployment pipeline for NukeVersionParser #292
This file contains 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
name: Test and deploy pipeline | |
run-name: Testing and deployment pipeline for NukeVersionParser | |
on: | |
push: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Move to correct location | |
run: cd ${GITHUB_WORKSPACE} | |
- name: Install pip requirements | |
run: pip install -r requirements.txt | |
- name: Run pytest | |
run: pytest | |
parser: | |
needs: pytest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Move to correct location | |
run: cd ${GITHUB_WORKSPACE} | |
- name: Install pip requirements | |
run: pip install -r requirements.txt | |
- name: Run parser | |
run: | | |
export JSON_WRITE_DIRECTORY=${GITHUB_WORKSPACE} | |
python collect_data.py | |
- name: Push data | |
run: | | |
git config user.name 'Github Actions' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git branch | |
git pull | |
if [[ -n $(git status -s) ]]; then | |
git commit -a -m "Parse new data." | |
git push | |
else | |
echo "No changes to commit." | |
fi | |