Skip to content

Commit

Permalink
🚧chore:migrate unimported to knip
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Sep 27, 2024
1 parent 6cf1258 commit 978a023
Show file tree
Hide file tree
Showing 22 changed files with 4,443 additions and 3,156 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
jobs:
determine-affected:
name: "Turbo Affected"
uses: LedgerHQ/ledger-live/.github/workflows/turbo-affected-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/turbo-affected-reusable.yml@chores/knip
with:
head_branch: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
base_branch: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
Expand All @@ -24,65 +24,65 @@ jobs:
name: "Build Desktop"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && github.event.pull_request.head.repo.full_name == github.repository }}
uses: LedgerHQ/ledger-live/.github/workflows/build-desktop-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/build-desktop-reusable.yml@chores/knip
secrets: inherit

test-desktop:
name: "Test Desktop"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-desktop-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-desktop-reusable.yml@chores/knip
secrets: inherit

# LLM
build-mobile:
name: "Build Mobile"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/build-mobile-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/build-mobile-reusable.yml@chores/knip
secrets: inherit

test-mobile:
name: "Test Mobile"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@chores/knip
secrets: inherit

test-mobile-e2e:
name: "Test Mobile E2E"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-e2e-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-e2e-reusable.yml@chores/knip
secrets: inherit

# Tests
test-libraries:
name: "Test Libraries"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'libs') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-libs-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-libs-reusable.yml@chores/knip
secrets: inherit

test-design-system:
name: "Test Design System"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'libs/ui') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-design-system-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-design-system-reusable.yml@chores/knip
secrets: inherit

test-web-tools:
name: "Test Web Tools"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'apps/web-tools') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-web-tools-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-web-tools-reusable.yml@chores/knip
secrets: inherit

test-cli:
name: "Test CLI"
needs: determine-affected
if: ${{contains(needs.determine-affected.outputs.paths, 'apps/cli') && github.event.pull_request.head.repo.full_name == github.repository}}
uses: LedgerHQ/ledger-live/.github/workflows/test-cli-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-cli-reusable.yml@chores/knip
secrets: inherit

# Final Check required
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-desktop-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ jobs:
ref: ${{ inputs.ref || github.sha }}

- name: Setup git user
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@chores/knip

- name: Setup the toolchain
id: toolchain
if: ${{ matrix.config.name != 'linux' }}
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@chores/knip
with:
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Setup the caches
id: caches
if: ${{ matrix.config.name == 'linux' }}
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@chores/knip
with:
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
Expand All @@ -83,7 +83,7 @@ jobs:

- name: Build desktop
id: build-desktop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-build-desktop@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-build-desktop@chores/knip
with:
os: ${{ matrix.config.name }}

Expand Down Expand Up @@ -154,15 +154,15 @@ jobs:
}
return JSON.stringify(obj);
- uses: LedgerHQ/ledger-live/tools/actions/build-checks@develop
- uses: LedgerHQ/ledger-live/tools/actions/build-checks@chores/knip
if: ${{ !cancelled() && inputs.prNumber != '' }}
with:
token: ${{ steps.generate-token.outputs.token }}
baseBranch: ${{ inputs.base_ref || 'develop' }}
prNumber: ${{ inputs.prNumber }}
mode: desktop

- uses: LedgerHQ/ledger-live/tools/actions/desktop-report-build@develop
- uses: LedgerHQ/ledger-live/tools/actions/desktop-report-build@chores/knip
name: Report summary
with:
token: ${{ steps.generate-token.outputs.token }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build-mobile-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
with:
ref: ${{ inputs.ref || github.sha }}
- name: Setup git user
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@chores/knip
- name: Setup the caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@chores/knip
id: caches
with:
skip-turbo-cache: "false"
Expand All @@ -52,12 +52,12 @@ jobs:
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- name: install dependencies
run: pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm
- uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@develop
- uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@chores/knip
id: version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: set beta name
uses: LedgerHQ/ledger-live/tools/actions/change-product-name@develop
uses: LedgerHQ/ledger-live/tools/actions/change-product-name@chores/knip
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
- name: Get short SHA
Expand All @@ -75,7 +75,7 @@ jobs:
NODE_OPTIONS: "--max-old-space-size=7168"
ANDROID_KEYSTORE_FILE: ${{ github.workspace }}/apps/ledger-live-mobile/android/app/staging.kstr
run: pnpm build-ci:llm:android --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
- uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@develop
- uses: LedgerHQ/ledger-live/tools/actions/get-package-infos@chores/knip
id: post-version
with:
path: ${{ github.workspace }}/apps/ledger-live-mobile
Expand All @@ -95,9 +95,9 @@ jobs:
with:
ref: ${{ inputs.ref || github.sha }}
- name: Setup git user
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@chores/knip
- name: Setup the toolchain
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@chores/knip
id: caches
with:
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: mobile.metafile.json
- uses: LedgerHQ/ledger-live/tools/actions/build-checks@develop
- uses: LedgerHQ/ledger-live/tools/actions/build-checks@chores/knip
if: inputs.prNumber != ''
with:
token: ${{ steps.generate-token.outputs.token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-desktop-external-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: lint-desktop-external
path: ${{ github.workspace }}/apps/ledger-live-desktop/lint-desktop-external.json
- name: check for dead code
run: pnpm desktop unimported
run: pnpm knip-check --filter=./apps/ledger-live-desktop
shell: bash

unit-tests:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test-desktop-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
ref: ${{ inputs.ref || github.sha }}
- name: Setup the toolchain
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@chores/knip
id: toolchain
with:
install-dotnet: true
Expand All @@ -50,7 +50,7 @@ jobs:
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@develop
- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@chores/knip
id: setup-test-desktop
with:
skip_builds: true
Expand All @@ -68,7 +68,7 @@ jobs:
name: lint-desktop
path: ${{ github.workspace }}/apps/ledger-live-desktop/lint-desktop.json
- name: check for dead code
run: pnpm desktop unimported
run: pnpm knip-check --filter=./apps/ledger-live-desktop
shell: bash

unit-tests:
Expand All @@ -84,14 +84,14 @@ jobs:
ref: ${{ inputs.ref || github.sha }}
- name: Setup the toolchain
id: toolchain
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@chores/knip
with:
skip-turbo-cache: "false"
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@develop
- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@chores/knip
id: setup-test-desktop
with:
skip_builds: true
Expand All @@ -118,14 +118,14 @@ jobs:
ref: ${{ inputs.ref || github.sha }}
- name: Setup caches
id: caches
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-caches@chores/knip
with:
skip-turbo-cache: "false"
accountId: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
roleName: ${{ secrets.AWS_CACHE_ROLE_NAME }}
region: ${{ secrets.AWS_CACHE_REGION }}
turbo-server-token: ${{ secrets.TURBOREPO_SERVER_TOKEN }}
- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@develop
- uses: LedgerHQ/ledger-live/tools/actions/composites/setup-test-desktop@chores/knip
id: setup-test-desktop
with:
skip_ruby: true
Expand All @@ -137,7 +137,7 @@ jobs:
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright
- name: upload diffs to s3
if: ${{ !cancelled() }}
uses: LedgerHQ/ledger-live/tools/actions/upload-images@develop
uses: LedgerHQ/ledger-live/tools/actions/upload-images@chores/knip
id: s3
with:
path: apps/ledger-live-desktop/tests/artifacts/test-results
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
fs.writeFileSync("./images.json", JSON.stringify(result, null, 2));
- name: prepare comment with screenshots
id: comment
uses: LedgerHQ/ledger-live/tools/actions/prepare-comment-screenshots@develop
uses: LedgerHQ/ledger-live/tools/actions/prepare-comment-screenshots@chores/knip
with:
images: images.json
no-actor: true
Expand Down Expand Up @@ -424,7 +424,7 @@ jobs:
with:
ref: ${{ ((github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'pull_request') && (inputs.ref || github.ref_name)) || github.sha }}
- name: Send Results and Generate Allure Report - Linux
uses: LedgerHQ/ledger-live/tools/actions/composites/upload-allure-report@develop
uses: LedgerHQ/ledger-live/tools/actions/composites/upload-allure-report@chores/knip
if: ${{ !cancelled() }}
with:
platform: linux
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ permissions:
jobs:
test-desktop:
name: "Test Desktop"
uses: LedgerHQ/ledger-live/.github/workflows/test-desktop-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-desktop-reusable.yml@chores/knip
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/test-mobile-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Run linter
run: pnpm lint --filter="live-mobile" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo" -- --format="json" -o="lint-mobile.json"
- name: check for dead code
run: pnpm mobile unimported
run: pnpm knip-check --filter="live-mobile"
shell: bash
- name: Run code checkers
run: pnpm typecheck --filter="live-mobile" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ permissions:
jobs:
test-mobile:
name: "Test Mobile"
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@develop
uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@chores/knip
secrets: inherit
39 changes: 0 additions & 39 deletions apps/ledger-live-desktop/.unimportedrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"test:playwright:clean": "git clean -fdX tests/artifacts",
"typecheck": "node scripts/typecheck.js",
"check": "pnpm lint; pnpm typecheck",
"unimported": "unimported",
"assets:replace": "zx ./scripts/replace-assets.mjs"
"assets:replace": "zx ./scripts/replace-assets.mjs",
"knip-check": "pnpm knip --config ../../knip.json"
},
"dependencies": {
"@braze/web-sdk": "^4.6.3",
Expand Down Expand Up @@ -232,4 +232,4 @@
"vite-plugin-electron": "0.4.9",
"yargs": "^17.0.0"
}
}
}
Loading

0 comments on commit 978a023

Please sign in to comment.