Create CLI Tool #25
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 CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run compile | |
- name: Run CLI Command (expected to fail) | |
run: | | |
set +e | |
node out/cli.js -f sample_project | |
if [ $? -eq 0 ]; then | |
echo "Command succeeded unexpectedly" | |
exit 1 | |
fi | |
echo "Command failed as expected" | |
- name: Run CLI Command (expected to pass) | |
run: node out/cli.js -f sample_project_2 | |
- name: Run unit tests | |
run: npm test | |
- name: Run extension tests | |
run: xvfb-run -a npm run extension-test |