Fixed ES Modules compatibility #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Test | |
working-directory: ./e2e/esmCompatibility | |
run: npm install ${{ env.PACKAGE_FILENAME }} | |
- name: Install tar file | |
working-directory: ./e2e/esmCompatibility | |
run: npm install | |
- name: Build | |
working-directory: ./e2e/esmCompatibility | |
run: npm run generate 2> tmp.txt && cat tmp.txt | grep -vqz ERROR & exit 1 |