diff --git a/.github/workflows/deploy-ci.yaml b/.github/workflows/deploy-ci.yaml index 903095b..30643ef 100644 --- a/.github/workflows/deploy-ci.yaml +++ b/.github/workflows/deploy-ci.yaml @@ -12,6 +12,9 @@ permissions: jobs: Test: runs-on: ubuntu-latest + outputs: + src: ${{ steps.filter.outputs.src }} + test: ${{ steps.filter.outputs.test }} strategy: matrix: node-version: [ 20.x, 'lts/*' ] @@ -19,18 +22,30 @@ jobs: - uses: actions/checkout@v4 with: persist-credentials: false + - uses: dorny/paths-filter@v3.0.2 + id: filter + with: + filters: | + src: + - 'src/**' + test: + - '__tests__/** - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies + if: steps.filter.outputs.src == 'true' && steps.filter.outputs.test == 'true' run: npm install --ignore-scripts - name: Run Lint Fix + if: steps.filter.outputs.src == 'true' && steps.filter.outputs.test == 'true' run: npm run lint:fix - name: Run Unit Tests + if: steps.filter.outputs.src == 'true' && steps.filter.outputs.test == 'true' run: npm run test Release: runs-on: ubuntu-latest + if: ${{ needs.Test.outputs.src == 'true' && needs.Test.outputs.test == 'true' }} needs: [ 'Test' ] steps: - uses: actions/checkout@v4 @@ -57,6 +72,10 @@ jobs: needs: [ 'Release' ] if: github.ref == 'refs/heads/main' steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + ref: main - name: Configure Git run: | git config --global user.email "bugs5382@users.noreply.github.com"