refactor: to node action
This commit is contained in:
@@ -9,7 +9,60 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- name: Validate JSON
|
||||
- name: Validate Renovate Config
|
||||
uses: ./
|
||||
with:
|
||||
json-file: renovate.json
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- name: Cache dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
|
||||
- name: Install dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: npm ci
|
||||
- name: Typecheck
|
||||
run: npm run typecheck
|
||||
- name: Format code
|
||||
run: npm run format:check
|
||||
- name: Run test
|
||||
run: npm run test
|
||||
|
||||
check-dist:
|
||||
name: Check Dist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- name: Cache dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
|
||||
- name: Install dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: npm ci
|
||||
- run: mv dist dist_orig
|
||||
- run: npm run build
|
||||
- run: |
|
||||
original_hash=$(sha256sum dist_orig/index.js | cut -d' ' -f1)
|
||||
new_hash=$(sha256sum dist/index.js | cut -d' ' -f1)
|
||||
if [ "$original_hash" != "$new_hash" ]; then
|
||||
echo "Build is not up to date. Original hash: $original_hash, new hash: $new_hash"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -19,4 +19,4 @@ jobs:
|
||||
prerelease: true
|
||||
- uses: https://gitea.t000-n.de/t.behrendt/actions/release-git-tag@29f50ea246d5d9a62ac3c611fa5c8a6e9846df5a # 0.2.8
|
||||
with:
|
||||
tag: ${{ steps.tag.outputs.new-tag }}
|
||||
tag: ${{ steps.tag.outputs.new-tag }}
|
||||
|
||||
Reference in New Issue
Block a user