diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 13f26e1..76007ab 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -2,58 +2,48 @@ name: Test & Maybe Release on: [push, pull_request] jobs: test: - name: Node ${{ matrix.node }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: fail-fast: false matrix: - node: [14, 16] - # windows support not quite ready: os: [ubuntu-latest, windows-latest] - os: [ubuntu-latest] - + node: [16.x, 18.x, lts/*, current] + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - name: Clone repository + - name: Checkout Repository uses: actions/checkout@v3 - - - run: git fetch --prune --unshallow - - - name: Set Node.js version - uses: actions/setup-node@v3 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v3.6.0 with: node-version: ${{ matrix.node }} - - - run: node --version - - run: npm --version - - run: git --version - - - name: Install npm dependencies - run: npm install - + - name: Install Dependencies + run: | + npm install --no-progress - name: Run tests - run: npm test - + run: | + npm config set script-shell bash + npm run test:ci release: name: Release needs: test runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' - steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v3.6.0 with: - node-version: 14 - + node-version: lts/* - name: Install dependencies run: | npm install --no-progress --no-package-lock --no-save - + - name: Build + run: | + npm run build - name: Install plugins run: | npm install \ @@ -65,9 +55,9 @@ jobs: @semantic-release/git \ @semantic-release/changelog \ --no-progress --no-package-lock --no-save - - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release + diff --git a/package.json b/package.json index 8ff8936..e7d7954 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "scripts": { "lint": "standard", "format": "standard --fix", + "build": "true", + "test:ci": "npm run test", "test": "npm run lint" }, "author": "Rod (http://r.va.gg/)",