aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: a23f25392774b54ffb5253900f516762c615c0f0 (plain) (blame)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Nikola CI
on:
  # Run on all pushes to master (including merge of PR)
  push:
    branches: master
  # Run on all changes in pull requests
  pull_request:
  # Run every Saturday at 17:10 UTC to ensure stability (dependency changes not breaking things)
  schedule:
    - cron: '10 17 * * 6'

jobs:
  nikola:
    name: Nikola tests (Python ${{ matrix.python }} on ${{ matrix.image }})
    strategy:
      fail-fast: false
      matrix:
        python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
        image:
          - ubuntu-latest
        include:
          - python: '3.12'
            image: macos-latest
          - python: '3.12'
            image: windows-latest
    runs-on: '${{ matrix.image }}'
    steps:
      - name: Check out code
        uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '${{ matrix.python }}'
      - name: Upgrade packaging stack
        run: |
          python -m pip install --upgrade-strategy eager -U pip setuptools wheel
      - name: Install test requirements
        run: |
          python -m pip install --upgrade-strategy eager -Ur requirements-tests.txt
      - name: Install Nikola
        run: |
          python -m pip install .
      - name: Run tests
        run: |
          py.test tests/
      - name: Run nikola
        run: |
          nikola
      - name: Run nikola help
        run: |
          nikola help

  baseline:
    name: Baseline testing (Python ${{ matrix.python }} on ${{ matrix.image }})
    strategy:
      fail-fast: false
      matrix:
        python: ['3.12']
        image:
          - ubuntu-latest
    runs-on: '${{ matrix.image }}'
    steps:
      - name: Check out code
        uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '${{ matrix.python }}'
      - name: Upgrade packaging stack
        run: |
          python -m pip install --upgrade-strategy eager -U pip setuptools wheel
      - name: Install extra requirements
        run: |
          python -m pip install --upgrade-strategy eager -Ur requirements-extras.txt freezegun
      - name: Install Nikola
        run: |
          python -m pip install .
      - name: Compare to baseline
        run: |
          scripts/baseline.sh check

  flake8:
    name: Linting (flake8, pydocstyle)
    strategy:
      matrix:
        python:
          - '3.12'
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '${{ matrix.python }}'
      - name: Upgrade packaging stack
        run: |
          python -m pip install --upgrade-strategy eager -U pip setuptools wheel
      - name: Install requirements
        run: |
          python -m pip install flake8 pydocstyle
      - name: Run flake8
        run: |
          flake8 nikola/ tests/
      - name: Run pydocstyle
        run: |
          pydocstyle --count --match-dir='(?!^\\.)(?!data).*' nikola/

  basereq:
    name: Build demo site with base requirements
    strategy:
      matrix:
        python:
          - '3.11'
          - '3.12'
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '${{ matrix.python }}'
      - name: Upgrade packaging stack
        run: |
          python -m pip install --upgrade-strategy eager -U pip setuptools wheel
      - name: Install requirements
        run: |
          python -m pip install --upgrade-strategy eager -Ur requirements.txt
      - name: Install Nikola
        run: |
          python -m pip install .
      - name: Run help
        run: |
          nikola help
        working-directory: /
      - name: Run init
        run: |
          nikola init -qd nsite
        working-directory: /tmp/
      - name: Run build
        run: |
          nikola build
        working-directory: /tmp/nsite