30070f7f9c
CD / Release (push) Successful in 33s
Refactoring the action from a composite to Node action. This change improves security through pinning of packages as well as better test-ability and error handling. Reviewed-on: #47 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
dry-run:
|
|
name: Dry-Run
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
- 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
|