Update toolchain #10
Workflow file for this run
This file contains 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
name: Update toolchain | |
on: | |
schedule: | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: chore/update-toolchain | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
update-toolchain: | |
runs-on: ["ledgerhq-device-sdk"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-toolchain-composite@develop | |
- name: Setup git and branch | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout -b ${{ env.BRANCH_NAME }} | |
- name: Update toolchain | |
run: | | |
proto outdated --update | |
- name: Check for changes | |
id: changes | |
run: | | |
echo "status=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Set new versions | |
if: steps.changes.outputs.status > 0 | |
run: | | |
proto use | |
pnpm i | |
- name: Health check | |
if: steps.changes.outputs.status > 0 | |
id: health-check | |
run: pnpm health-check | |
- name: Tests | |
id: unit-tests | |
if: steps.changes.outputs.status > 0 && success() | |
run: pnpm test:coverage -- --max-warnings=0 | |
- name: Create PR | |
if: steps.changes.outputs.status > 0 && success() | |
run: | | |
git add .prototools | |
git commit -m "π§ (repo) [NO-ISSUE]: Update toolchain" | |
git push origin ${{ env.BRANCH_NAME }} | |
gh pr create \ | |
--title "π§ (repo) [NO-ISSUE]: Update toolchain" \ | |
--body "This PR updates the toolchain (node, npm, pnpm) to the newest versions" \ | |
--base develop \ | |
--head ${{ env.BRANCH_NAME }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |