💬 Apply suggestions from code review #123
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
| # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
| name: Package | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| dependencies: | |
| name: Dependencies | |
| if: "!contains(github.event.commits[0].message, '[skip ci]')" | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| node: ["16.17.0"] | |
| npm: ["8.15.0"] | |
| steps: | |
| - name: Cancel previous runs | |
| uses: styfle/cancel-workflow-action@0.9.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - uses: actions/checkout@v2 | |
| - name: Setup Node.js 16.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 16.x | |
| cache: "npm" | |
| - name: Retrieve cached dependencies | |
| uses: actions/cache@v3 | |
| id: npm-cache | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-windows-latest-${{ matrix.npm }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }} | |
| - name: Install all dependencies | |
| if: steps.npm-cache.outputs.cache-hit != 'true' | |
| run: npm ci | |
| test: | |
| name: Tests | |
| needs: [dependencies] | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| node: ["16.17.0"] | |
| npm: ["8.15.0"] | |
| steps: | |
| - name: Cancel previous runs | |
| uses: styfle/cancel-workflow-action@0.9.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 16.x | |
| cache: "npm" | |
| - name: Retrieve cached dependencies | |
| uses: actions/cache@v3 | |
| id: npm-cache | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-windows-latest-${{ matrix.npm }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }} | |
| - name: Run The Tests | |
| run: npm run test | |
| package-dev: | |
| name: Package Dev Build | |
| needs: [dependencies, test] | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| node: ["16.17.0"] | |
| npm: ["8.15.0"] | |
| steps: | |
| - name: Cancel previous runs | |
| uses: styfle/cancel-workflow-action@0.9.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 16.x | |
| cache: "npm" | |
| - name: Retrieve cached dependencies | |
| uses: actions/cache@v3 | |
| id: npm-cache | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-windows-latest-${{ matrix.npm }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }} | |
| - name: package it up | |
| run: npm run pack-dev | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dev-release-zip | |
| path: "cyberpunk2077-dev-*.7z" | |
| package-release: | |
| name: Package | |
| needs: [dependencies, test] | |
| if: "(contains(github.event.commits[0].message, 'release') || contains(github.event.commits[1].message, 'release')) && !contains(github.event.commits[0].message, 'gonk')" | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| node: ["16.17.0"] | |
| npm: ["8.15.0"] | |
| steps: | |
| - name: Cancel previous runs | |
| uses: styfle/cancel-workflow-action@0.9.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 16.x | |
| cache: "npm" | |
| - name: Retrieve cached dependencies | |
| uses: actions/cache@v3 | |
| id: npm-cache | |
| with: | |
| path: | | |
| node_modules | |
| key: ${{ runner.os }}-windows-latest-${{ matrix.npm }}-${{ matrix.node }}-${{ hashFiles('package.lock') }} | |
| - name: package it up | |
| run: npm run pack | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-zip | |
| path: "cyberpunk2077-*.7z" |