-
Notifications
You must be signed in to change notification settings - Fork 111
63 lines (58 loc) · 2.03 KB
/
no-bad-latin.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
# This action initially adopted from The Turing Way from in October 2020.
# doi:10.5281/zenodo.3233853
# https://github.com/alan-turing-institute/the-turing-way/blob/af98c94/.github/workflows/no-bad-latin.yml
#
# This action triggers the script tools/no-bad-latin.py to and will throw an error if any latin expression (like e.g. or i.e.) is detected:
#
# This action will be triggered
# - on a push to master
# - on a PR to the master branch and will only check files that were modified in src
name: Check for Latin Phrases
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Decide when to run the tests
#
# This configuration sets the test to run on pushes to master
# and on pull requests that are opened to master
on:
push:
branches:
- main
pull_request:
branches: ['*']
# Set up the Continuous Integration job
jobs:
latin-phrases:
# Run on the latest Ubuntu distribution
runs-on: ubuntu-latest
# This section collects together the steps involved in running the test
steps:
# Checkout the repository. Relies on another GH-Action.
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# Set up the Python version. Relies on another GH-Action.
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
# Install Python dependencies
- name: Install dependencies
working-directory: ./tools
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
# Run a Python script
- name: Run Python script to check for latin phrases - Master
working-directory: ./tools
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
python no-bad-latin.py
- name: Run Python script to check for latin phrases - Pull Request
working-directory: ./tools
if: github.event.pull_request
run: |
python no-bad-latin.py --pull-request ${{ github.event.pull_request.number }}