MNIST example fixes #109
This file contains hidden or 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: Run pre-commit checks | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: kasperskydh/knp-build-image | |
| volumes: | |
| - ${{ github.workspace }}:/KNP | |
| options: --cpus 1 | |
| steps: | |
| - name: Set git options | |
| run: git config --global --add safe.directory "*" | |
| shell: bash | |
| - uses: actions/checkout@v3 | |
| - id: changed_files | |
| uses: trilom/file-changes-action@v1.2.4 | |
| with: | |
| output: ' ' | |
| - run: ln -s /usr/bin/python3 /usr/bin/python | |
| shell: bash | |
| - run: mkdir -p ~/.config/pip/ && echo -e "[global]\nbreak-system-packages = true" > ~/.config/pip/pip.conf | |
| shell: bash | |
| - run: git config --global --add safe.directory /KNP | |
| shell: bash | |
| - name: Run pre-commit | |
| run: pre-commit run --show-diff-on-failure --color=always --files ${{ steps.changed_files.outputs.files}} || cat /github/home/.cache/pre-commit/pre-commit.log | |
| working-directory: /KNP | |
| shell: bash |