chore: upgrade zshy #47
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: π Validate | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: π¨ Build and Validate | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [22, 24] | |
steps: | |
- name: π₯ Checkout | |
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: π¨ Build | |
run: npm run build | |
- name: πΎ Cache build output | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
dist/ | |
key: build-${{ matrix.node-version }}-${{ github.sha }} | |
- name: π Type check | |
run: npm run typecheck | |
- name: π§Ή Lint | |
run: npm run lint | |
- name: π§ͺ Test | |
run: npm run test:coverage | |
- name: π Upload coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
e2e: | |
name: π E2E Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
node-version: [24] | |
steps: | |
- name: π₯ Checkout | |
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: π¨ Build | |
run: npm run build | |
# ensure we don't implicitly rely on dev dependencies | |
- name: π¦ Prune dependencies | |
run: npm prune --omit=dev | |
- name: π§ͺ Run cross-env e2e tests | |
run: node e2e/test-cross-env.js | |
- name: π Run cross-env-shell e2e tests | |
run: node e2e/test-cross-env-shell.js | |
release: | |
name: π Release | |
needs: [build, e2e] | |
runs-on: ubuntu-latest | |
if: | |
${{ github.repository == 'kentcdodds/cross-env' && | |
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', | |
github.ref) && github.event_name == 'push' }} | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: π Restore build output | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
dist/ | |
key: build-24-${{ github.sha }} | |
fail-on-cache-miss: false | |
- name: π Release | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
semantic_version: 24 | |
branches: | | |
[ | |
'+([0-9])?(.{+([0-9]),x}).x', | |
'main', | |
'next', | |
'next-major', | |
{name: 'beta', prerelease: true}, | |
{name: 'alpha', prerelease: true} | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |