Skip to content

Refactor CI test runs to run against the code built and packaged instead of source #186

Refactor CI test runs to run against the code built and packaged instead of source

Refactor CI test runs to run against the code built and packaged instead of source #186

Workflow file for this run

name: CI - tests
on:
pull_request:
branches: [master]
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: ./.github/actions/ci-common-setup
- name: Build and pack library locally
id: pkg-pack
run: |
echo "pkg_pack_results=$(pnpm pack --json | jq -c)" >> $GITHUB_OUTPUT
- run: |
PACKAGE_FILENAME=$(echo '${{ steps.pkg-pack.outputs.pkg_pack_results }}')
echo $PACKAGE_FILENAME
# - name: Install locally-packaged library
# run: |
# pnpm i packaged-react-async-iterators@file:./${{fromJson(steps.pkg-pack.outputs.pkg_pack_results)[0].filename}}
# - name: Run tests against packaged library code
# run: |
# [[ -e ./src ]] && mv ./src ./src-ignored-for-packaged-testing
# echo 'export * from "packaged-react-async-iterators";' > ./spec/libEntrypoint.ts
# pnpm test
# [[ -e ./src-ignored-for-packaged-testing ]] && mv ./src-ignored-for-packaged-testing ./src