Add a test workflow that runs on every branch #125
Copy link
Copy link
Labels
testingTesting relatedTesting related
Description
Why: nothing runs on branches or PRs today. A broken build or a VSIX missing the server JAR is only found when a release tag is pushed. Running on every push gives feedback while a branch is in progress, before a PR is even opened.
What: add .github/workflows/test.yml:
- Triggers:
pushon all branches (branches: ['**']) andpull_request. - Avoid running twice for the same commit: run
pull_requestjobs only for PRs from forks (if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository). Branches in this repo are already covered bypush. concurrency: { group: test-${{ github.ref }}, cancel-in-progress: true }, so a new push cancels the older run on the same branch.
It runs:
npm ci- lint and a
tsc --noEmittype-check - a server build (
mvn -B package) vsce package, then a check that the VSIX containsserver/language-server-liquidjava.jarandmedia/webview.js
Later issues add their tests to this workflow. Everything in this workflow runs on every branch; only the slower wider checks (#132 and #134) are limited to PRs, main or a schedule.
References:
- vscode-java runs compile,
vsce package, lint and tests on every push and PR: https://github.com/redhat-developer/vscode-java/blob/main/.github/workflows/pr-verify.yml (on: [push, pull_request], so every branch push is checked) - GitHub docs, cancelling older runs with
concurrency: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs - rust-analyzer runs typecheck, lint, format check, tests and packaging in CI: https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/ci.yaml
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
testingTesting relatedTesting related
Activity
Run build and packaging checks on pull requests and main (#138)