|
17 | 17 | jobs: |
18 | 18 | prepare: |
19 | 19 | runs-on: ubuntu-latest |
| 20 | + environment: open-env |
20 | 21 | steps: |
21 | 22 | - name: Checkout |
22 | 23 | uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + fetch-depth: 2 |
| 26 | + |
| 27 | + - name: Is environment ok |
| 28 | + run: | |
| 29 | + echo $SAUCE_USERNAME |
| 30 | +
|
| 31 | + - name: Get specific changed files |
| 32 | + id: source-changed |
| 33 | + uses: tj-actions/changed-files@v1.1.3 |
| 34 | + with: |
| 35 | + files: | |
| 36 | + src |
| 37 | + test |
| 38 | + karma.conf.js |
| 39 | + Gruntfile.js |
| 40 | + rollup.config.js |
23 | 41 |
|
24 | 42 | - name: Install node.js |
| 43 | + if: steps.source-changed.outputs.any_changed == 'true' |
25 | 44 | uses: actions/setup-node@v1 |
26 | 45 | with: |
27 | 46 | node-version: 14.x |
28 | 47 |
|
29 | 48 | - name: Install xvfb |
| 49 | + if: steps.source-changed.outputs.any_changed == 'true' |
30 | 50 | run: | |
31 | 51 | sudo apt-get install xvfb |
32 | 52 | Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & |
33 | 53 |
|
34 | 54 | - name: Install dependencies |
| 55 | + if: steps.source-changed.outputs.any_changed == 'true' |
35 | 56 | run: | |
36 | 57 | npm install |
37 | 58 | npm install -g grunt-cli |
38 | 59 | node_modules/.bin/rollup -c |
39 | 60 |
|
40 | 61 | - name: Install saucectl |
| 62 | + if: steps.source-changed.outputs.any_changed == 'true' |
41 | 63 | uses: saucelabs/saucectl-run-action@v1 |
42 | 64 | with: |
43 | 65 | skip-run: true |
44 | 66 | testing-environment: "" |
45 | 67 | concurrency: 10 |
46 | 68 |
|
47 | | - - run: | |
| 69 | + - name: Grunt test |
| 70 | + if: steps.source-changed.outputs.any_changed == 'true' |
| 71 | + run: | |
48 | 72 | grunt --version |
49 | 73 | sed -i '/log.info(`Check out job at/a\\ console.log(`::set-output name=urls-${sessionId}::${getSauceEndpoint(browserData.region)}${sessionId}`);' node_modules/karma-sauce-launcher/dist/reporter/reporter.js || true |
50 | 74 |
|
51 | 75 | - name: Run tests |
| 76 | + if: steps.source-changed.outputs.any_changed == 'true' |
52 | 77 | run: grunt karma:saucelabs |
53 | 78 | id: test |
54 | 79 |
|
55 | 80 | - name: Run code coverage |
| 81 | + if: steps.source-changed.outputs.any_changed == 'true' |
56 | 82 | uses: paambaati/codeclimate-action@v2.7.5 |
57 | 83 | with: |
58 | 84 | coverageCommand: grunt karma:coverage |
|
66 | 92 | run: ls -lhR coverage || true |
67 | 93 |
|
68 | 94 | - uses: LouisBrunner/checks-action@v1.1.1 |
69 | | - if: always() |
| 95 | + if: steps.source-changed.outputs.any_changed == 'true' |
70 | 96 | with: |
71 | 97 | token: ${{ secrets.GITHUB_TOKEN }} |
72 | 98 | name: Testsuite passed |
|
0 commit comments