-
Notifications
You must be signed in to change notification settings - Fork 63
146 lines (140 loc) · 3.73 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
examples:
runs-on: ubuntu-latest
name: Test ${{ matrix.project }} on Node.js
strategy:
fail-fast: false
matrix:
project:
- helia-101
- helia-browser-verified-fetch
- helia-cjs
- helia-electron
- helia-esbuild
- helia-jest
- helia-jest-typescript
- helia-nestjs
- helia-nextjs
- helia-parcel
- helia-script-tag
- helia-ts-node
- helia-typescript
- helia-vite
- helia-vue
- helia-webpack
- helia-create-car
- helia-lan-discovery
defaults:
run:
working-directory: examples/${{ matrix.project }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Install Playwright
run: npx -y playwright install --with-deps
- name: Run tests
run: npm run test
env:
CI: true
bun:
runs-on: ubuntu-latest
name: Test ${{ matrix.project }} on bun
strategy:
fail-fast: false
matrix:
project:
- helia-101
defaults:
run:
working-directory: examples/${{ matrix.project }}
steps:
- uses: actions/checkout@v3
# bun calls to nodejs under the hood for some reason
# - uses: actions/setup-node@v4
# with:
# node-version: lts/*
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
with:
bun-version: latest
# - name: re-alias node to bun
# run: |
# shopt -s expand_aliases
# alias node=bun
- name: Install dependencies
run: bun install && bun pm trust protobufjs node-datachannel && bun install
- name: Install Playwright
run: bun add --global playwright && playwright install --with-deps
- name: Run tests
run: NODE_EXEC=bun bun run test
env:
CI: true
NODE_EXEC: bun
monorepo:
runs-on: ubuntu-latest
name: Test monorepo
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm install
- name: Install Playwright
run: npx -y playwright install --with-deps
- name: Run linting
run: npm run lint
env:
CI: true
- name: Run tests
run: npm run test -- --concurrency 1
env:
CI: true
push-changes:
name: Push changes
runs-on: ubuntu-latest
needs: [monorepo, examples]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
strategy:
fail-fast: true
matrix:
project:
- helia-101
- helia-cjs
- helia-browser-verified-fetch
- helia-electron
- helia-esbuild
- helia-jest
- helia-jest-typescript
- helia-nestjs
- helia-parcel
- helia-nextjs
- helia-script-tag
- helia-ts-node
- helia-typescript
- helia-vite
- helia-vue
- helia-webpack
- helia-create-car
- helia-lan-discovery
steps:
- uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be
with:
owner: ipfs-examples
repo: ${{ matrix.project }}
github_token: ${{ secrets.REPO_PULL_TOKEN }}
workflow_file_name: sync.yml