|
1 |
| - |
2 | 1 | on:
|
3 |
| - push: |
4 |
| - branches: |
5 |
| - - master |
6 | 2 | pull_request:
|
| 3 | + push: |
7 | 4 | branches:
|
8 | 5 | - master
|
9 | 6 |
|
| 7 | +env: |
| 8 | + METEOR_VERSION: 2.6.1 |
| 9 | + |
10 | 10 | jobs:
|
11 | 11 | build:
|
12 | 12 | name: Build and Install
|
13 | 13 | runs-on: ubuntu-latest
|
14 | 14 | steps:
|
15 |
| - - uses: actions/checkout@v3 |
16 |
| - - name: Cache dependencies |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - name: Get Cache dependencies |
17 | 17 | uses: actions/cache@v3
|
18 | 18 | id: files-cache
|
19 | 19 | with:
|
20 |
| - path: | |
21 |
| - node_modules |
22 |
| - dist/ |
23 |
| - ~/.meteor |
24 |
| - /tmp/tests/.__tmp_int |
25 |
| - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
| 20 | + path: | |
| 21 | + dist |
| 22 | + node_modules |
| 23 | + /tmp/.__tmp_int |
| 24 | + ~/.meteor |
| 25 | + ~/.npm |
| 26 | + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
26 | 27 | - name: Install/Retrieve Meteor
|
27 | 28 | if: steps.files-cache.outputs.cache-hit != 'true'
|
28 |
| - run: curl https://install.meteor.com/?release=2.6.1 | /bin/sh |
| 29 | + run: curl https://install.meteor.com/?release=${{ env.METEOR_VERSION }} | /bin/sh |
29 | 30 | - name: Install NPM Dependencies
|
| 31 | + # Creates dist/ through postinstall->build script |
30 | 32 | if: steps.files-cache.outputs.cache-hit != 'true'
|
31 |
| - run: meteor npm ci |
| 33 | + run: ~/.meteor/meteor npm ci |
| 34 | + - name: Run build script |
| 35 | + # Make sure dist/ is up-to-date when package-lock.json hasn't changed |
| 36 | + if: steps.files-cache.outputs.cache-hit == 'true' |
| 37 | + run: ~/.meteor/meteor npm run build |
32 | 38 |
|
33 |
| - test: |
| 39 | + unit-tests: |
34 | 40 | needs: build
|
35 | 41 | name: Unit Tests
|
36 | 42 | runs-on: ubuntu-latest
|
37 | 43 | steps:
|
38 |
| - - uses: actions/checkout@v3 |
39 |
| - - name: Get Cache dependencies |
40 |
| - uses: actions/cache@v3 |
41 |
| - id: files-cache |
42 |
| - with: |
43 |
| - path: | |
44 |
| - node_modules |
45 |
| - dist/ |
46 |
| - ~/.meteor |
47 |
| - /tmp/tests/.__tmp_int |
48 |
| - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
49 |
| - - name: Unit Tests |
50 |
| - run: ~/.meteor/meteor npm run test |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + - name: Get Cache dependencies |
| 46 | + uses: actions/cache@v3 |
| 47 | + id: files-cache |
| 48 | + with: |
| 49 | + path: | |
| 50 | + dist |
| 51 | + node_modules |
| 52 | + /tmp/.__tmp_int |
| 53 | + ~/.meteor |
| 54 | + ~/.npm |
| 55 | + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
| 56 | + - name: Run test script |
| 57 | + run: ~/.meteor/meteor npm run test |
51 | 58 |
|
52 |
| - test-integration: |
| 59 | + integration-tests: |
53 | 60 | needs: build
|
54 | 61 | name: Integration Tests
|
55 | 62 | runs-on: ubuntu-latest
|
56 | 63 | steps:
|
57 |
| - - uses: actions/checkout@v3 |
| 64 | + - uses: actions/checkout@v4 |
58 | 65 | - name: Get Cache dependencies
|
59 | 66 | uses: actions/cache@v3
|
60 | 67 | id: files-cache
|
61 | 68 | with:
|
62 |
| - path: | |
63 |
| - node_modules |
64 |
| - dist/ |
65 |
| - ~/.meteor |
66 |
| - /tmp/tests/.__tmp_int |
67 |
| - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
| 69 | + path: | |
| 70 | + dist |
| 71 | + node_modules |
| 72 | + /tmp/.__tmp_int |
| 73 | + ~/.meteor |
| 74 | + ~/.npm |
| 75 | + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} |
68 | 76 | - run: ~/.meteor/meteor npm run prepare-integration-tests
|
69 |
| - - run: ~/.meteor/meteor npm run test-integration |
| 77 | + - name: Run test-integration script (using Xvfb) |
| 78 | + uses: coactions/setup-xvfb@v1 |
| 79 | + with: # needs full path to meteor |
| 80 | + run: /home/runner/.meteor/meteor npm run test-integration |
0 commit comments