|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: [master] |
| 8 | + |
| 9 | +jobs: |
| 10 | + python-3-8: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + env: |
| 14 | + PERCY_ENABLE: 0 |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python 3.8 |
| 21 | + uses: actions/setup-python@v5 |
| 22 | + with: |
| 23 | + python-version: '3.8' |
| 24 | + |
| 25 | + - name: Set up Chrome |
| 26 | + uses: browser-actions/setup-chrome@v1 |
| 27 | + with: |
| 28 | + install-chromedriver: true |
| 29 | + |
| 30 | + - name: Cache pip dependencies |
| 31 | + uses: actions/cache@v4 |
| 32 | + with: |
| 33 | + path: ~/.cache/pip |
| 34 | + key: ${{ runner.os }}-pip-3.8-${{ hashFiles('tests/requirements.txt') }} |
| 35 | + restore-keys: | |
| 36 | + ${{ runner.os }}-pip-3.8- |
| 37 | +
|
| 38 | + - name: Install requirements |
| 39 | + run: | |
| 40 | + python -m pip install --upgrade pip |
| 41 | + pip install -r tests/requirements.txt --quiet |
| 42 | +
|
| 43 | + - name: Run tests |
| 44 | + run: pytest |
| 45 | + |
| 46 | + python-3-12-install-test: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + env: |
| 50 | + PERCY_ENABLE: 0 |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Checkout |
| 54 | + uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Set up Python 3.12 |
| 57 | + uses: actions/setup-python@v5 |
| 58 | + with: |
| 59 | + python-version: '3.12' |
| 60 | + |
| 61 | + - name: Set up Node.js |
| 62 | + uses: actions/setup-node@v4 |
| 63 | + with: |
| 64 | + node-version: '20' |
| 65 | + |
| 66 | + - name: Set up Chrome |
| 67 | + uses: browser-actions/setup-chrome@v1 |
| 68 | + with: |
| 69 | + install-chromedriver: true |
| 70 | + |
| 71 | + - name: Cache pip dependencies |
| 72 | + uses: actions/cache@v4 |
| 73 | + with: |
| 74 | + path: ~/.cache/pip |
| 75 | + key: ${{ runner.os }}-pip-3.12-${{ hashFiles('tests/requirements.txt') }} |
| 76 | + restore-keys: | |
| 77 | + ${{ runner.os }}-pip-3.12- |
| 78 | +
|
| 79 | + - name: Install requirements |
| 80 | + run: | |
| 81 | + python -m pip install --upgrade pip |
| 82 | + pip install -r tests/requirements.txt --quiet |
| 83 | +
|
| 84 | + - name: Generate project and test |
| 85 | + run: | |
| 86 | + mkdir test_install |
| 87 | + cd test_install |
| 88 | + cookiecutter .. --config-file ../tests/test_config.yaml --no-input |
| 89 | + cd test_component |
| 90 | + python -m venv venv |
| 91 | + . venv/bin/activate |
| 92 | + pip install -r tests/requirements.txt --quiet |
| 93 | + npm install --ignore-scripts |
| 94 | + npm run build |
| 95 | + pytest |
0 commit comments