📝 Add GitLab CI/CD examples #364
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
# SPDX-FileCopyrightText: 2023 Veit Schiele | |
# | |
# SPDX-License-Identifier: BSD-3-Clause | |
name: pre-commit | |
on: [push, pull_request] | |
jobs: | |
pre-commit: | |
# External pull requests should be checked, but not our own internal pull | |
# requests again, as these are already checked by the push on the branch. | |
# Without this if condition, the checks would be performed twice, as | |
# internal pull requests correspond to both the push and pull_request | |
# events. | |
if: | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- uses: pre-commit/action@v3.0.1 |