|
1 | | -Create a new file called `main.yml` inside `.github/workflows` with the following content: |
| 1 | +Create a new file called `js-test-and-release.yml` inside `.github/workflows` with the following content: |
2 | 2 |
|
3 | 3 | ```yml |
4 | | -name: ci |
| 4 | +name: test & maybe release |
| 5 | + |
5 | 6 | on: |
6 | 7 | push: |
7 | 8 | branches: |
8 | | - - master |
| 9 | + - main |
9 | 10 | pull_request: |
10 | | - branches: |
11 | | - - master |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: write |
| 15 | + id-token: write |
| 16 | + packages: write |
| 17 | + pull-requests: write |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} |
| 21 | + cancel-in-progress: true |
12 | 22 |
|
13 | 23 | jobs: |
14 | | - check: |
15 | | - runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - uses: actions/checkout@v2 |
18 | | - - run: npm install |
19 | | - - run: npx aegir lint |
20 | | - - run: npx aegir build |
21 | | - - run: npx aegir dep-check |
22 | | - - run: npx aegir doc-check |
23 | | - - uses: ipfs/aegir/actions/bundle-size@master |
24 | | - with: |
25 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
26 | | - test-node: |
27 | | - needs: check |
28 | | - runs-on: ${{ matrix.os }} |
29 | | - strategy: |
30 | | - matrix: |
31 | | - os: [windows-latest, ubuntu-latest, macos-latest] |
32 | | - node: [14, 16] |
33 | | - fail-fast: true |
34 | | - steps: |
35 | | - - uses: actions/checkout@v2 |
36 | | - - uses: actions/setup-node@v1 |
37 | | - with: |
38 | | - node-version: ${{ matrix.node }} |
39 | | - - run: npm install |
40 | | - - run: npx aegir test -t node --bail --cov |
41 | | - - uses: codecov/codecov-action@v1 |
42 | | - test-chrome: |
43 | | - needs: check |
44 | | - runs-on: ubuntu-latest |
45 | | - steps: |
46 | | - - uses: actions/checkout@v2 |
47 | | - - uses: microsoft/playwright-github-action@v1 |
48 | | - - run: npm install |
49 | | - - run: npx aegir test -t browser --bail --cov |
50 | | - - run: npx aegir test -t webworker --bail |
51 | | - - uses: codecov/codecov-action@v1 |
52 | | - test-firefox: |
53 | | - needs: check |
54 | | - runs-on: ubuntu-latest |
55 | | - steps: |
56 | | - - uses: actions/checkout@v2 |
57 | | - - uses: microsoft/playwright-github-action@v1 |
58 | | - - run: npm install |
59 | | - - run: npx aegir test -t browser -t webworker --bail -- --browser firefox |
60 | | - test-webkit: |
61 | | - needs: check |
62 | | - runs-on: ubuntu-latest |
63 | | - steps: |
64 | | - - uses: actions/checkout@v2 |
65 | | - - uses: microsoft/playwright-github-action@v1 |
66 | | - - run: npm install |
67 | | - - run: npx aegir test -t browser -t webworker --bail -- --browser webkit |
68 | | - test-electron-main: |
69 | | - needs: check |
70 | | - runs-on: ubuntu-latest |
71 | | - steps: |
72 | | - - uses: actions/checkout@v2 |
73 | | - - run: npm install |
74 | | - - run: npx xvfb-maybe aegir test -t electron-main --bail |
75 | | - test-electron-renderer: |
76 | | - needs: check |
77 | | - runs-on: ubuntu-latest |
78 | | - steps: |
79 | | - - uses: actions/checkout@v2 |
80 | | - - run: npm install |
81 | | - - run: npx xvfb-maybe aegir test -t electron-renderer --bail |
| 24 | + js-test-and-release: |
| 25 | + uses: ipdxco/unified-github-workflows/.github/workflows/js-test-and-release.yml@v1.0 |
| 26 | + secrets: |
| 27 | + DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} |
| 28 | + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} |
| 29 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 30 | + UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }} |
| 31 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
82 | 32 | ``` |
0 commit comments