[ON_PR fsm-shell] b70270688de4a0518a240beab5b9af0f3f4ab28f #44
Workflow file for this run
This file contains hidden or 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: fsm-shell pull request | |
| run-name: '[ON_PR fsm-shell] ${{ github.sha }}' | |
| on: | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| ensure-mandatory-files: | |
| runs-on: ubuntu-latest | |
| continue-on-error: true # Some changes are only relevant for the documentation page | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check | |
| env: | |
| REQUIRED_FILES: CHANGELOG.md package.json package-lock.json | |
| run: | | |
| git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
| FILES_CHANGED=$(git diff --diff-filter='AMTCR' --name-only origin/master HEAD | tr '[:upper:]' '[:lower:]') | |
| echo $FILES_CHANGED | |
| array=( $REQUIRED_FILES ) | |
| missing_files="" | |
| for i in "${array[@]}" | |
| do | |
| i_lower=$(echo "$i" | tr '[:upper:]' '[:lower:]') | |
| [[ ${FILES_CHANGED[*]} =~ $i_lower ]] && echo "$i file found in the changeset" || missing_files="$missing_files $i" | |
| done | |
| echo "" | |
| [ -z "$missing_files" ] && echo "All mandatory files have been modified" || echo "Following files $missing_files have not been modified" | |
| [ -z "$missing_files" ] && exit 0 || exit 1 | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm i | |
| - name: Unit tests | |
| run: npm run test:ci:headless | |
| test-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm i | |
| - name: Run build | |
| run: npm run build |