new test-tool to verify .github/settings.yml of each book repo #1085
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: tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * 0' # weekly | |
jobs: | |
tests: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Setup | |
run: | | |
npm install | |
- name: Build Extension | |
run: | | |
case "$GITHUB_EVENT_NAME" in | |
push) | |
VERSION_VALUE=${GITHUB_SHA:0:7};; | |
pull_request) | |
VERSION_VALUE=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH");; | |
*) | |
VERSION_VALUE="unknown";; | |
esac | |
echo $VERSION_VALUE | |
sed -Ei 's/("version": ")(.+)(",)$/\1\2-'$VERSION_VALUE'\3/' package.json | |
npm run build:production | |
- name: Upload Extension | |
uses: actions/upload-artifact@v2 | |
with: | |
name: editor-extension | |
path: editor-*.vsix | |
- name: Test | |
run: | | |
xvfb-run -a npm run test | |
- name: Upload Code Coverage | |
uses: codecov/codecov-action@v3 | |
- name: Lint | |
run: | | |
npm run lint |