Skip to content

Commit

Permalink
Run embedded JS API test on both dart and node compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Oct 28, 2024
1 parent 7ffed6e commit 257b4fd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ jobs:
working-directory: sass-spec

sass_spec_js_embedded:
name: 'JS API Tests | Embedded | Node ${{ matrix.node-version }} | ${{ matrix.os }}'
name: "JS API Tests | Embedded ${{ matrix.js && 'Pure JS' || 'Dart' }} | Node ${{ matrix.node-version }} | ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
if: "github.event_name != 'pull_request' || !contains(github.event.pull_request.body, 'skip sass-embedded')"

strategy:
fail-fast: false
matrix:
js: [true, false]
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['lts/*']
include:
Expand Down Expand Up @@ -166,19 +167,25 @@ jobs:
- name: Initialize embedded host
run: |
npm install
npm run init -- --compiler-path=.. --language-path=../build/language
npm run init -- --compiler-path=.. --language-path=../build/language --compiler-js=${{ matrix.js && 'true' || 'false' }}
npm run compile
if ${{ matrix.js && 'false' || 'true' }}; then
mv {`pwd`/,dist/}lib/src/vendor/dart-sass
fi
working-directory: embedded-host-node

- name: Version info
run: |
if ${{ matrix.js && 'true' || 'false' }}; then
node embedded-host-node/node_modules/sass/sass.js --version
else
path=embedded-host-node/dist/lib/src/vendor/dart-sass/sass
if [[ -f "$path.cmd" ]]; then "./$path.cmd" --version
elif [[ -f "$path.bat" ]]; then "./$path.bat" --version
elif [[ -f "$path.exe" ]]; then "./$path.exe" --version
else "./$path" --version
fi
fi
- name: Run tests
run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../build/language
Expand Down

0 comments on commit 257b4fd

Please sign in to comment.