-
-
Notifications
You must be signed in to change notification settings - Fork 23
59 lines (47 loc) · 1.75 KB
/
compatibility.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
name: Test Compatibility with ESM
on:
# run it on push to the default repository branch
push:
branches: [main]
# run it during pull request
pull_request:
jobs:
build-and-test-compatibility:
name: Build application code
# use system defined below in the tests matrix
runs-on: ${{ matrix.os }}
strategy:
# define the test matrix
matrix:
# selected operation systems to run CI
os: [ubuntu-latest] #, windows-latest, macos-latest]
# selected node version to run CI
node-version: [20.11.1]
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
# use the node version defined in matrix above
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Pack Emmett locally
shell: bash
run: echo "PACKAGE_FILENAME=$(npm pack --json --pack-destination './e2e/esmCompatibility' -w @event-driven-io/emmett | jq -r '.[] | .filename')" >> $GITHUB_ENV
- name: Install tar file
working-directory: ./e2e/esmCompatibility
run: npm install ${{ env.PACKAGE_FILENAME }}
- name: Install
working-directory: ./e2e/esmCompatibility
run: npm install
- name: Build 1
working-directory: ./e2e/esmCompatibility
run: npm run generate
- name: Build
working-directory: ./e2e/esmCompatibility
run: npm run generate 2> tmp.txt && cat tmp.txt | grep -q "\[ERROR\]" && (echo "::error ::[ERROR] found, failing the step." && false) || echo "No errors found, proceeding..."