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