forked from the-turing-way/the-turing-way
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.57 KB
/
lorem-ipsums.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
# Give your test a name!
name: Check for Lorem Ipsums
# Decide when to run the tests
#
# This configuration sets the test to run on pushes to main
# and on pull requests that are opened to main
on:
push:
branches:
- main
paths:
- "book/**"
pull_request:
branches:
- main
paths:
- "book/**"
# Set up the Continuous Integration job
jobs:
lorem-ipsums:
if: (github.event.pull_request) && !contains(github.head_ref, 'all-contributors')
# 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@v2
# Set up the Python version. Relies on another GH-Action.
- name: Setup Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
# Install Python dependencies
- name: Install dependencies
working-directory: ./tests
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 rogue "Lorem ipsums" - Pull Request
working-directory: ./tests
if: github.event.pull_request
run: |
python lorem-ipsums.py --pull-request ${{ github.event.pull_request.number }}
- name: Run Python script to check for rogue "Lorem ipsums" - Master
working-directory: ./tests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
python lorem-ipsums.py