fix: allow same-version releases (#52) #40
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| retention-days: 1 | |
| lint: | |
| name: Lint & Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - run: npx eslint . | |
| - run: npx prettier --check . | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - run: npx tsc --noEmit | |
| test: | |
| name: Test (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - run: npm test | |
| cli-smoke: | |
| name: CLI Smoke Test | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Run CLI help | |
| run: node bin/pack-config-diff --help | |
| - name: Compare JS fixtures | |
| run: | | |
| rc=0 | |
| node bin/pack-config-diff --left=fixtures/webpack.dev.js --right=fixtures/webpack.prod.js --format=summary > /tmp/smoke-js.txt 2>&1 || rc=$? | |
| cat /tmp/smoke-js.txt | |
| if [ "$rc" -gt 1 ]; then echo "::error::CLI crashed (exit code $rc)"; exit 1; fi | |
| if [ ! -s /tmp/smoke-js.txt ]; then echo "::error::CLI produced no output"; exit 1; fi | |
| - name: Compare YAML fixtures | |
| run: | | |
| rc=0 | |
| node bin/pack-config-diff --left=fixtures/webpack-development-client.yaml --right=fixtures/webpack-production-client.yaml --format=json > /tmp/smoke-yaml.txt 2>&1 || rc=$? | |
| cat /tmp/smoke-yaml.txt | |
| if [ "$rc" -gt 1 ]; then echo "::error::CLI crashed (exit code $rc)"; exit 1; fi | |
| if [ ! -s /tmp/smoke-yaml.txt ]; then echo "::error::CLI produced no output"; exit 1; fi | |
| - name: Compare with markdown output | |
| run: | | |
| rc=0 | |
| node bin/pack-config-diff --left=fixtures/webpack.dev.js --right=fixtures/webpack.prod.js --format=markdown > /tmp/smoke-md.txt 2>&1 || rc=$? | |
| cat /tmp/smoke-md.txt | |
| if [ "$rc" -gt 1 ]; then echo "::error::CLI crashed (exit code $rc)"; exit 1; fi | |
| if [ ! -s /tmp/smoke-md.txt ]; then echo "::error::CLI produced no output"; exit 1; fi |