Skip to content

Commit

Permalink
chore: simplify (#50)
Browse files Browse the repository at this point in the history
* Reset workspace permissions no longer needed

* Use caching in setup-node

* cache-dependency-path

* Restore ownership reset
  • Loading branch information
DerekRoberts authored Apr 11, 2024
1 parent 8b3a854 commit d2fc2b4
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
required: true

### Typical / recommended
cache:
description: Package manager for caching; e.g. npm, yarn, pnpm
default: npm

sonar_args:
# https://docs.sonarcloud.io/advanced-setup/analysis-parameters/
description: SonarCloud command line arguments
Expand Down Expand Up @@ -97,23 +101,15 @@ runs:
if: steps.diff.outputs.triggered == 'true'
with:
node-version: ${{ inputs.node_version }}
- id: npm-cache-dir
if: steps.diff.outputs.triggered == 'true'
shell: bash
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
if: steps.diff.outputs.triggered == 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
cache: ${{ inputs.cache }}
cache-dependency-path: ${{ inputs.dir }}/package-lock.json

# Run tests, hopefully generating coverage for SonarCloud
- name: Run Tests
if: steps.diff.outputs.triggered == 'true'
- if: steps.diff.outputs.triggered == 'true'
shell: bash
working-directory: ${{ inputs.dir }}
run: |
cd ${{ inputs.dir }}
# Run Tests
${{ inputs.commands }}
### Optional SonarCloud
Expand Down

0 comments on commit d2fc2b4

Please sign in to comment.