Merge pull request #230 from yangwu1227/generator-workflow

feat: generator workflow post-merge
This commit is contained in:
Nicolas P. Rougier 2025-02-19 21:35:29 +01:00 committed by GitHub
commit 814f08ea8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 49 additions and 5 deletions

View File

@ -0,0 +1,46 @@
name: Generate Solutions Files
on:
push:
branches:
- master
paths:
- source/exercises100.ktx
jobs:
generate_files:
runs-on: ubuntu-22.04 # Python 3.7 is not supported on latest Ubuntu
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.7'
cache: 'pip'
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Generate solutions files
run: python3 generators.py
- name: Set environment variables
run: echo "SHA_SHORT=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "solutions update from ${{ env.SHA_SHORT }}"
file_pattern: >
100_Numpy_exercises.ipynb
100_Numpy_random.ipynb
100_Numpy_exercises.md
100_Numpy_exercises_with_hints.md
100_Numpy_exercises_with_hints_with_solutions.md
100_Numpy_exercises_with_solutions.md

View File

@ -1,5 +1,3 @@
numpy==1.17.4 numpy
pandas==0.25.3 mdutils
jupyter==1.0.0 nbformat
jupyterthemes==0.20.0
mdutils==1.0.0