chore(js): use express built-in middleware for parsing JSON instead o… #17
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: Generate JavaScript app | |
on: | |
push: | |
jobs: | |
generate-app: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone source code | |
uses: actions/checkout@v3.1.0 # https://github.com/actions/checkout | |
with: | |
# Whether to configure the token or SSH key with the local git config. Default: true | |
persist-credentials: false | |
- name: Setup NodeJS | |
uses: actions/setup-node@v3.5.1 # https://github.com/actions/setup-node | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Install project dependencies | |
run: npm ci --no-audit --no-fund # https://docs.npmjs.com/cli/v8/commands/npm-ci | |
- name: Generate JavaScript + Express application | |
run: ../../src/cli.js --lang js | |
working-directory: examples/js | |
- name: Check whether all modified files have been committed | |
run: >- | |
MODIFIED_FILES="$(git status --short)"; | |
if [ -n "$MODIFIED_FILES" ]; then | |
echo >&2 "ERROR: the following generated files have not been committed:"; | |
echo >&2 "$MODIFIED_FILES"; | |
exit 1; | |
fi |