Repository navigation
Merge remote-tracking branch 'origin/codex/issue-125-test-workflow' i… #43
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: Test | |
| on: | |
| push: | |
| branches: ['**'] | |
| pull_request: | |
| workflow_call: | |
| concurrency: | |
| group: test-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| name: Checks | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: client/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| - name: Type-check | |
| run: npx tsc --noEmit | |
| - name: Build server | |
| working-directory: server | |
| run: | | |
| mvn -B package | |
| mkdir -p ../client/server | |
| cp target/language-server-liquidjava.jar ../client/server/ | |
| - name: Package extension | |
| run: npx vsce package --out liquid-java.vsix | |
| - name: Check packaged runtime files | |
| run: | | |
| unzip -Z1 liquid-java.vsix > /tmp/liquid-java-vsix-files.txt | |
| grep -Fx 'extension/dist/server/language-server-liquidjava.jar' /tmp/liquid-java-vsix-files.txt | |
| grep -Fx 'extension/media/webview.js' /tmp/liquid-java-vsix-files.txt | |
| integration: | |
| name: VS Code integration (${{ matrix.version }}) | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ (github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && fromJSON('["stable", "minimum"]') || fromJSON('["stable"]') }} | |
| defaults: | |
| run: | |
| working-directory: client | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| id: java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: client/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build server | |
| run: npm run build:server | |
| - name: Run VS Code fixture tests | |
| env: | |
| JAVA_HOME: ${{ steps.java.outputs.path }} | |
| VSCODE_TEST_VERSION: ${{ matrix.version }} | |
| run: xvfb-run -a npm test | |
| - name: Upload VS Code logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vscode-logs-${{ matrix.version }} | |
| path: client/.vscode-test/user-data/logs | |
| if-no-files-found: ignore |