diff --git a/.github/workflows/ci.yaml b/.github/workflows/build.yaml similarity index 55% rename from .github/workflows/ci.yaml rename to .github/workflows/build.yaml index 495ed6b..11106d0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build & Test VSCode Extension +name: Build on: push: @@ -12,7 +12,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: @@ -28,12 +28,9 @@ jobs: - name: Install dependencies run: npm ci - - name: Build monorepo + - name: Build all run: npm run build - - name: Compile TypeScript - run: npx tsc - - name: Package VSIX run: npx vsce package --out dist/openmcp.vsix @@ -43,18 +40,3 @@ jobs: name: openmcp-${{ matrix.os }} path: dist/openmcp.vsix - # test: - # needs: build - # runs-on: ubuntu-latest - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # node-version: '22.x' - # cache: 'npm' - - # - name: Install test dependencies - # run: npm install && npm run test \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..65fe4f8 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,41 @@ +name: Test + +on: + push: + branches: + - main + release: + types: + - published + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Install xvfb (Linux only) + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y xvfb + + - name: Run Test with XVFB (Linux) + if: runner.os == 'Linux' + run: xvfb-run --auto-servernum npm run test + + - name: Run Test (Windows/macOS) + if: runner.os != 'Linux' + run: npm run test \ No newline at end of file