Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support/pin pr workflow deps #8117

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ permissions:

jobs:
assign-author:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: toshimaru/[email protected]
58 changes: 25 additions & 33 deletions .github/workflows/build-desktop-external-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ jobs:
build-desktop-app:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
name: "Build Ledger Live Desktop"
runs-on: ${{ matrix.os }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a result of the workflows in build-desktop-external-reusable.yml and build-desktop-reusable.yml drifting out of sync, as they are partial copy-pasted duplicates of each other. Would love to remove as much duplication as possible (ideally delete the unused workflow)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. We don't want to use our internal runners for external contributions. So I think that ubuntu-latest is used for Github runner. Can you double check, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - fixed

config:
[
{ name: "linux", os: "ubuntu-22.04", image: "linux-x86_64.AppImage" },
{ name: "win", os: "windows-2022", dotnet: true, image: "win-x64.exe" },
{ name: "mac", os: "macos-14", image: "mac.dmg" },
]
runs-on: ${{ matrix.config.os }}
name: "Build LLD (external) | ${{ matrix.config.name }}"
outputs:
linux: ${{ steps.save-result.outputs.ubuntu-latest }}
windows: ${{ steps.save-result.outputs.windows-latest }}
mac: ${{ steps.save-result.outputs.macos-latest }}
linux: ${{ steps.save-result.outputs.linux }}
windows: ${{ steps.save-result.outputs.win }}
mac: ${{ steps.save-result.outputs.mac }}
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
Expand All @@ -35,11 +40,11 @@ jobs:
with:
result-encoding: string
script: |
if ("${{ matrix.os }}" === "ubuntu-latest") {
if ("${{ matrix.config.name }}" === "linux") {
return "linux"
} else if ("${{ matrix.os }}" === "macos-latest") {
} else if ("${{ matrix.config.name }}" === "mac") {
return "mac"
} else if ("${{ matrix.os }}" === "windows-latest") {
} else if ("${{ matrix.config.name }}" === "win") {
return "win"
}
- uses: actions/checkout@v4
Expand All @@ -52,15 +57,15 @@ jobs:
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-git-user@develop
- uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.13.0"
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Setup the toolchain
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-toolchain@develop
with:
upgrade_npm: ${{ matrix.os == 'windows-latest' }}
upgrade_npm: ${{ matrix.config.name == 'win' }}
- name: Build desktop
uses: LedgerHQ/ledger-live/tools/actions/composites/setup-build-desktop@develop
id: build-desktop
Expand All @@ -74,29 +79,16 @@ jobs:
shell: bash
if: ${{ !cancelled() }}
run: |
echo "${{matrix.os}}=${{steps.build-app.outcome}}" >> $GITHUB_OUTPUT
- name: Upload linux app
if: matrix.os == 'ubuntu-latest'
echo "${{matrix.config.name}}=${{steps.build-app.outcome}}" >> $GITHUB_OUTPUT
- name: Upload app
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-desktop.outputs.version }}-linux-x86_64.AppImage
path: ${{ github.workspace }}/apps/ledger-live-desktop/dist/${{ steps.build-desktop.outputs.name }}-${{ steps.build-desktop.outputs.version }}-linux-x86_64.AppImage
- name: Upload macOS app
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-desktop.outputs.version }}-mac.dmg
path: ${{ github.workspace }}/apps/ledger-live-desktop/dist/${{ steps.build-desktop.outputs.name }}-${{ steps.build-desktop.outputs.version }}-mac.dmg
- name: Upload windows
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build-desktop.outputs.version }}-win-x64.exe
path: ${{ github.workspace }}/apps/ledger-live-desktop/dist/${{ steps.build-desktop.outputs.name }}-${{ steps.build-desktop.outputs.version }}-win-x64.exe
name: ${{ steps.build-desktop.outputs.version }}-${{ matrix.config.image }}
path: ${{ github.workspace }}/apps/ledger-live-desktop/dist/${{ steps.build-desktop.outputs.name }}-${{ steps.build-desktop.outputs.version }}-${{ matrix.config.image }}

report:
needs: build-desktop-app
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ !cancelled() && github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/github-script@v7
Expand All @@ -116,23 +108,23 @@ jobs:
});

const findJobUrl = os =>
jobs.find(job => job.name == `Build Ledger Live Desktop (${os})`)?.html_url;
jobs.find(job => job.name == `Build LLD (external) | ${os}`)?.html_url;

const keys = {
mac: {
symbol: "🍏",
name: "macOS",
jobUrl: findJobUrl("macos-latest")
jobUrl: findJobUrl("mac")
},
windows: {
symbol: "πŸͺŸ",
name: "Windows",
jobUrl: findJobUrl("windows-latest")
jobUrl: findJobUrl("win")
},
linux: {
symbol: "🐧",
name: "Linux",
jobUrl: findJobUrl("ubuntu-latest")
jobUrl: findJobUrl("linux")
},
};

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-desktop-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
config:
[
{ name: "linux", os: "ledger-live-4xlarge", image: "linux-x86_64.AppImage" },
{ name: "win", os: "windows-latest", dotnet: true, image: "win-x64.exe" },
{ name: "mac", os: "macos-latest", image: "mac.dmg" },
{ name: "win", os: "windows-2022", dotnet: true, image: "win-x64.exe" },
{ name: "mac", os: "macos-14", image: "mac.dmg" },
]
name: "Build LLD | ${{ matrix.config.name }}"
runs-on: ${{ matrix.config.os }}
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:

report:
needs: build-desktop-app
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ !cancelled() && (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'pull_request')}}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-mobile-external-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
path: ${{ github.workspace }}/apps/ledger-live-mobile/android/app/build/outputs/apk/stagingRelease

build-mobile-app-ios:
runs-on: macos-latest
runs-on: macos-14
name: "Build Ledger Live Mobile (Mac OS X)"
env:
NODE_OPTIONS: "--max-old-space-size=7168"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-mobile-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
path: ${{ github.workspace }}/apps/ledger-live-mobile/mobile.metafile.json

report:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [build-mobile-app-android, build-mobile-app-ios]
if: ${{ !cancelled() && (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'pull_request' ) }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions:

jobs:
lint-commits:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -51,7 +51,7 @@ jobs:
name: commitlint
path: ${{ github.workspace }}/commitlint.out
report:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [lint-commits]
if: ${{ !cancelled() }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: generate token
id: generate-token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-prerelease-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
release-translation-check:
name: release branch translation check
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ github.ref_name != 'release' }}
steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-desktop-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
env:
NODE_OPTIONS: "--max-old-space-size=7168"
FORCE_COLOR: 3
CI_OS: ubuntu-latest
runs-on: ubuntu-latest
CI_OS: ubuntu-22.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -76,8 +76,8 @@ jobs:
env:
NODE_OPTIONS: "--max-old-space-size=7168"
FORCE_COLOR: 3
CI_OS: ubuntu-latest
runs-on: ubuntu-latest
CI_OS: ubuntu-22.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
NODE_OPTIONS: "--max-old-space-size=7168"
INSTRUMENT_BUILD: true
FORCE_COLOR: 3
CI_OS: "ubuntu-latest"
CI_OS: "ubuntu-22.04"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
LC_ALL: en_US.UTF-8
# DEBUG: "pw:browser*"
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
path: apps/ledger-live-desktop/allure-results
report:
needs: [codechecks, unit-tests, e2e-tests-linux]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ !cancelled() }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-libs-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
report:
needs: [test-docs, test-libraries, codecheck-libraries]
if: ${{ !cancelled() && github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-mobile-e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ jobs:

report:
needs: [detox-tests-android, detox-tests-ios]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ !cancelled() && (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'pull_request') }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -452,7 +452,7 @@ jobs:
path: ${{ github.workspace }}/summary-detox.json

report-on-slack:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [detox-tests-android, detox-tests-ios]
if: ${{ failure() && github.event_name == 'push' }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion tools/actions/composites/setup-test-desktop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:
- name: Install node-gyp globally
if: ${{ inputs.install_node_gyp }}
run: |
pnpm add -g node-gyp
pnpm add -g node-gyp@3.8.0
shell: bash
- name: Install dependencies
env:
Expand Down
10 changes: 6 additions & 4 deletions tools/actions/turbo-affected/build/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18925,7 +18925,7 @@ var package_default = {
"doc:ljs": 'pnpm turbo doc --no-daemon --filter="./libs/ledgerjs/**"',
"watch:ljs": 'pnpm turbo watch --no-daemon --filter="./libs/ledgerjs/**"',
"watch:common": "pnpm turbo watch --no-daemon --filter=./libs/ledger-live-common",
"dev:cli": "pnpm turbo watch --no-daemon --filter=@ledgerhq/live-cli",
"dev:cli": "pnpm turbo watch --filter=@ledgerhq/live-cli",
"dev:lld": "pnpm turbo start --no-daemon --filter=ledger-live-desktop",
"dev:lld:debug": "DEV_TOOLS=1 LEDGER_INTERNAL_ARGS=--inspect ELECTRON_ARGS=--remote-debugging-port=8315 pnpm turbo start --no-daemon --filter=ledger-live-desktop",
"dev:llm": "pnpm turbo start --no-daemon --filter=live-mobile",
Expand Down Expand Up @@ -19073,14 +19073,15 @@ var package_default = {
"@ledgerhq/devices": "workspace:*",
tslib: "2.6.2",
"@hashgraph/sdk>@grpc/grpc-js": "1.6.7",
"@hashgraph/sdk>@hashgraph/cryptography": "1.1.2"
"@hashgraph/sdk>@hashgraph/cryptography": "1.1.2",
"@ethersproject/providers>ws": "7.5.10"
},
patchedDependencies: {
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"detox@20.23.0": "patches/detox@20.23.0.patch",
"detox@20.26.2": "patches/detox@20.26.2.patch",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"@hashgraph/[email protected]": "patches/@[email protected]",
Expand Down Expand Up @@ -19111,6 +19112,7 @@ async function main() {
const pkg = core.getInput("package") || "";
const command = core.getInput("command");
const turboVersion = package_default.devDependencies.turbo;
const packageManager = package_default.packageManager;
try {
const turboOutput = (0, import_child_process.execSync)(
`npx turbo@${turboVersion} run ${command} --filter=...[${ref}] --dry=json`,
Expand All @@ -19119,7 +19121,7 @@ async function main() {
maxBuffer: 2048 * 1024
}
);
const pnpmOutput = (0, import_child_process.execSync)(`npx pnpm list -r --depth=0 --json`, {
const pnpmOutput = (0, import_child_process.execSync)(`npx ${packageManager} list -r --depth=0 --json`, {
encoding: "utf-8",
maxBuffer: 2048 * 1024
});
Expand Down
3 changes: 2 additions & 1 deletion tools/actions/turbo-affected/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ async function main() {
const pkg = core.getInput("package") || "";
const command = core.getInput("command");
const turboVersion = packageJson.devDependencies.turbo;
const packageManager = packageJson.packageManager; // pnpm@<version_specified_in_package.json>

try {
const turboOutput = execSync(
Expand All @@ -16,7 +17,7 @@ async function main() {
maxBuffer: 2048 * 1024,
},
);
const pnpmOutput = execSync(`npx pnpm list -r --depth=0 --json`, {
const pnpmOutput = execSync(`npx ${packageManager} list -r --depth=0 --json`, {
encoding: "utf-8",
maxBuffer: 2048 * 1024,
});
Expand Down
Loading