CI #54
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: CI | |
| on: | |
| schedule: | |
| - cron: "0 4 * * 0" # Every Sunday at 4 AM UTC (Sunday night in most US timezones) | |
| push: | |
| tags: | |
| - "*.*.*" | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile TypeScript | |
| run: npm run compile | |
| - name: Run unit tests | |
| run: npm run test | |
| - name: Run integration tests (Ubuntu) | |
| run: xvfb-run -a npm run test:ci | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Run integration tests (Windows/macOS) | |
| run: npm run test:ci | |
| if: matrix.os != 'ubuntu-latest' | |
| - name: Package extension | |
| run: npx vsce package | |
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' | |
| with: | |
| name: soar-extension | |
| path: "*.vsix" | |
| retention-days: 7 | |
| lint-markdown: | |
| name: Lint Markdown | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint markdown files | |
| run: npm run lint:md | |
| - name: Check markdown links | |
| run: npm run check:links | |
| continue-on-error: true | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: [build-and-test] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile TypeScript | |
| run: npm run compile | |
| - name: Package extension | |
| run: npx vsce package | |
| - name: Generate release notes with git-cliff | |
| uses: orhun/git-cliff-action@v4 | |
| with: | |
| config: cliff.toml | |
| args: --latest | |
| env: | |
| OUTPUT: release-notes.md | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: "*.vsix" | |
| body_path: release-notes.md | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |