|
| 1 | +name: Unit Tests |
| 2 | + |
| 3 | +# all pull requests |
| 4 | +on: pull_request |
| 5 | + |
| 6 | +jobs: |
| 7 | +# Running local tests is disabled due to outdated dependencies |
| 8 | +# see https://github.com/vaadin/components-team-tasks/issues/628 |
| 9 | +# unit-tests-p2: |
| 10 | +# name: Polymer 2 on the CI agent |
| 11 | +# runs-on: ubuntu-latest |
| 12 | +# steps: |
| 13 | +# - name: Set up Node 16.x |
| 14 | +# uses: actions/setup-node@v4 |
| 15 | +# with: |
| 16 | +# node-version: 16.x |
| 17 | +# |
| 18 | +# - name: Check out the source code |
| 19 | +# uses: actions/checkout@v2 |
| 20 | +# |
| 21 | +# - name: Install global npm dependencies |
| 22 | +# # bower is needed to run 'bower install' |
| 23 | +# # polymer-cli is needed to run the lint step |
| 24 | +# run: "npm install --quiet --no-progress --global bower polymer-cli" |
| 25 | +# |
| 26 | +# - name: Install project npm dependencies |
| 27 | +# run: "npm ci" |
| 28 | +# |
| 29 | +# - name: Install project Bower dependencies |
| 30 | +# run: "bower install --quiet" |
| 31 | +# |
| 32 | +# - name: Run automated magi-cli checks |
| 33 | +# run: "npm run check" |
| 34 | +# |
| 35 | +# - name: Run a linter |
| 36 | +# run: "npm run lint" |
| 37 | +# |
| 38 | +# # the full set of environments is tested with Polymer 3 below |
| 39 | +# - name: Run unit tests locally (in the VM instance running this job) |
| 40 | +# run: "xvfb-run -s '-screen 0 1024x768x24' npm test" |
| 41 | + |
| 42 | + unit-tests-p3: |
| 43 | + name: Polymer 3 on SauceLabs |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - name: Set up Node 16.x |
| 47 | + uses: actions/setup-node@v4 |
| 48 | + with: |
| 49 | + node-version: 16.x |
| 50 | + |
| 51 | + - name: Check out the (Polymer 2) source code |
| 52 | + uses: actions/checkout@v2 |
| 53 | + |
| 54 | + - name: Install global npm dependencies |
| 55 | + # bower and polymer-modulizer are needed to run the Polymer 3 conversion step |
| 56 | + run: "npm install --quiet --no-progress --global bower magi-cli polymer-modulizer" |
| 57 | + |
| 58 | + - name: Convert the source code to Polymer 3 |
| 59 | + run: | |
| 60 | + git config --local user.email "github-actions[bot]@users.noreply.github.com" |
| 61 | + git config --local user.name "github-actions[bot]" |
| 62 | + magi p3-convert --out . --import-style=name |
| 63 | +
|
| 64 | + # workaround for running tests on Android on SauceLabs (see wct.conf.js) |
| 65 | + - name: Add 'localhost-for-saucelabs' to /etc/hosts |
| 66 | + run: echo "127.0.0.1 localhost-for-saucelabs" | sudo tee -a /etc/hosts |
| 67 | + |
| 68 | + - name: Run unit tests [Desktop / Batch 1] |
| 69 | + env: |
| 70 | + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
| 71 | + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 72 | + run: npm test -- --env saucelabs --suites batch1 |
| 73 | + |
| 74 | + - name: Run unit tests [Desktop / Batch 2] |
| 75 | + env: |
| 76 | + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
| 77 | + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 78 | + run: npm test -- --env saucelabs --suites batch2 |
| 79 | + |
| 80 | + - name: Run unit tests [Desktop / Batch 3] |
| 81 | + env: |
| 82 | + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
| 83 | + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 84 | + run: npm test -- --env saucelabs --suites batch3 |
| 85 | + |
| 86 | + - name: Run unit tests [Desktop / Batch 4] |
| 87 | + env: |
| 88 | + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
| 89 | + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 90 | + run: npm test -- --env saucelabs --suites batch4 |
| 91 | + |
| 92 | + - name: Run unit tests [Desktop / Batch 5] |
| 93 | + env: |
| 94 | + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
| 95 | + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 96 | + run: npm test -- --env saucelabs --suites batch5 |
0 commit comments