summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yaml
blob: b2d7050ce275fe141a5a67b8b28b53d5f1de5050 (plain)
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
name: Pygments

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        python-version: [3.5, 3.6, 3.7, 3.8, 3.9, pypy3]
      max-parallel: 4

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install package
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
        pip install .
    - name: Test package
      run: make test TEST=-v
      if: runner.os == 'Linux'
    - name: Test package
      run: py.test
      if: runner.os == 'Windows' && ! contains(matrix['python-version'], 'pypy')

  check-mapfiles:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
    - name: Regenerate mapfiles
      run: make mapfiles
    - name: Fail if mapfiles changed
      run: |
        if git ls-files -m | grep mapping; then
          echo 'Please run "make mapfiles" and add the changes to a commit.'
          exit 1
        fi

  lint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Check out regexlint
      run: git clone https://github.com/pygments/regexlint
    - name: Run regexlint
      run: make regexlint REGEXLINT=`pwd`/regexlint