-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (44 loc) · 1.3 KB
/
test-bundle.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
name: Test-Bundle
on:
workflow_call:
inputs:
run:
description: "Forces a run if true"
required: false
type: boolean
push:
branches:
- main
pull_request: ~
jobs:
build:
if: ${{ github.actor != 'arabot-1' || inputs.run }}
name: Check bundle exports/imports
runs-on: ubuntu-latest
strategy:
matrix:
example: [cjs, esm, umd]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install deps & build
run: yarn
- name: Create tarball for importing in bundle checks
run: yarn pack --filename sdk-bundle-tests.tgz
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "\"@vocdoni/sdk\":[^\n]+"
replace: "\"@vocdoni/sdk\": \"file:../../../sdk-bundle-tests.tgz\""
regex: true
include: "test/bundle/${{ matrix.example }}/package.json"
- name: Run yarn install ${{ matrix.example }}
working-directory: test/bundle/${{ matrix.example }}
run: yarn
- name: Check ${{ matrix.example }} imports
working-directory: test/bundle/${{ matrix.example }}
run: yarn check:import