|
14 | 14 | # Allows you to run this workflow manually from the Actions tab |
15 | 15 | workflow_dispatch: |
16 | 16 |
|
17 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
18 | | -permissions: |
19 | | - contents: read |
20 | | - |
21 | 17 | jobs: |
22 | 18 | build: |
23 | 19 | strategy: |
24 | 20 | matrix: |
25 | 21 | node-version: [22] |
26 | 22 |
|
27 | 23 | # The type of runner that the job will run on |
28 | | - runs-on: macos-12 |
| 24 | + runs-on: macos-latest |
29 | 25 |
|
30 | 26 | steps: |
31 | 27 | - uses: actions/checkout@v6 |
32 | 28 |
|
33 | | - - name: Cache node modules |
| 29 | + - name: Cache Node modules |
34 | 30 | uses: actions/cache@v4 |
35 | | - env: |
36 | | - cache-name: cache-node-modules |
37 | 31 | with: |
38 | | - # npm cache files are stored in `~/.npm` on Linux/macOS |
| 32 | + # npm cache files are stored in ~/.npm |
39 | 33 | path: ~/.npm |
40 | | - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} |
| 34 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
41 | 35 | restore-keys: | |
42 | | - ${{ runner.os }}-build-${{ env.cache-name }}- |
43 | | - ${{ runner.os }}-build- |
44 | | - ${{ runner.os }}- |
| 36 | + ${{ runner.os }}-node- |
45 | 37 |
|
46 | 38 | - name: Use Node.js ${{ matrix.node-version }} |
47 | 39 | uses: actions/setup-node@v6 |
48 | 40 | with: |
49 | 41 | node-version: ${{ matrix.node-version }} |
50 | 42 |
|
| 43 | + - name: Install macOS dependencies |
| 44 | + if: matrix.platform == 'macos-latest' |
| 45 | + run: | |
| 46 | + brew install gnu-tar coreutils |
| 47 | + echo "Homebrew dependencies installed" |
| 48 | +
|
51 | 49 | - name: Install Dependencies |
52 | | - run: npm i && npm i -D cli-truncate iconv-corefoundation |
| 50 | + run: npm ci && npm i -D cli-truncate iconv-corefoundation |
53 | 51 |
|
54 | 52 | - name: Check lint |
55 | 53 | run: npm run lint |
56 | 54 |
|
| 55 | + - name: Install Playwright Browsers |
| 56 | + run: npx playwright@1.57.0 install --with-deps |
| 57 | + |
| 58 | + - name: Run headless unit test |
| 59 | + run: npm run test -- --reporters=default |
| 60 | + |
| 61 | + - name: Run headless e2e test |
| 62 | + run: npm run e2e |
| 63 | + |
57 | 64 | - name: Build the app |
58 | 65 | run: npm run electron:build |
0 commit comments