Fix verify-gpr global permissions and EACCES prefix, bump to 1.0.3 #9
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/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| release: | |
| types: [ published ] | |
| workflow_dispatch: | |
| jobs: | |
| # ============================================ | |
| # LINT AND TEST | |
| # ============================================ | |
| lint-and-test: | |
| name: Lint & Test (Node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./cloudsync-cli | |
| strategy: | |
| matrix: | |
| node: ['18', '20', '22'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: 'npm' | |
| cache-dependency-path: cloudsync-cli/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npm run lint || true | |
| - name: Run tests | |
| run: npm test | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./cloudsync-cli/coverage/lcov.info | |
| fail_ci_if_error: false | |
| # ============================================ | |
| # TEST ON WINDOWS | |
| # ============================================ | |
| test-windows: | |
| name: Test on Windows | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| working-directory: ./cloudsync-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: cloudsync-cli/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Test CLI help | |
| run: node bin/cloudsync.js --help | |
| # ============================================ | |
| # TEST ON MACOS | |
| # ============================================ | |
| test-macos: | |
| name: Test on macOS | |
| runs-on: macos-latest | |
| defaults: | |
| run: | |
| working-directory: ./cloudsync-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: cloudsync-cli/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| # ============================================ | |
| # SECURITY AUDIT | |
| # ============================================ | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./cloudsync-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run npm audit | |
| run: npm audit --audit-level=high || true | |
| # ============================================ | |
| # BUILD PACKAGE | |
| # ============================================ | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-test] | |
| defaults: | |
| run: | |
| working-directory: ./cloudsync-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: cloudsync-cli/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run build || true | |
| - name: Verify CLI | |
| run: | | |
| node bin/cloudsync.js --version | |
| node bin/cloudsync.js doctor | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cloudsync-cli-artifact | |
| path: | | |
| cloudsync-cli/bin/ | |
| cloudsync-cli/src/ | |
| cloudsync-cli/package.json | |
| cloudsync-cli/package-lock.json | |
| cloudsync-cli/LICENSE | |
| cloudsync-cli/README.md | |
| retention-days: 7 | |
| # ============================================ | |
| # PUBLISH TO NPM (on release) | |
| # ============================================ | |
| publish-npm: | |
| name: Publish to npm | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-test, test-windows, test-macos] | |
| if: github.event_name == 'release' | |
| defaults: | |
| run: | |
| working-directory: ./cloudsync-cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: cloudsync-cli/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |