-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: Add install-dependencies
parameter
#521
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d1857bd
add container job
ueokande 31b6e4a
add install-dependencies input
ueokande ec5d18e
support other distributions
ueokande 77b3a4c
run on other distributions
ueokande 782e944
install unzip on each distributions
ueokande 960734c
set PATH on suse
ueokande 50190e1
chore(ci): add container parameter to manual-test.yml
ueokande 686d18d
chore(docs): add install-dependencies to README
ueokande 7db0a7d
reduce container on CI
ueokande File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { pkg, runtime } from "actions-swing"; | ||
import type { Platform } from "./platform"; | ||
import * as core from "@actions/core"; | ||
|
||
const DEBIAN_BASED_DEPENDENT_PACKAGES = [ | ||
"libglib2.0-0", | ||
"libgconf-2-4", | ||
"libatk1.0-0", | ||
"libatk-bridge2.0-0", | ||
"libgdk-pixbuf2.0-0", | ||
"libgtk-3-0", | ||
"libgbm-dev", | ||
"libnss3-dev", | ||
"libxss-dev", | ||
"libasound2", | ||
"xvfb", | ||
"fonts-liberation", | ||
"libu2f-udev", | ||
"xdg-utils", | ||
]; | ||
|
||
const FEDORA_BASED_DEPENDENT_PACKAGES = [ | ||
"alsa-lib", | ||
"atk", | ||
"at-spi2-atk", | ||
"cups-libs", | ||
"libdrm", | ||
"libXcomposite", | ||
"libXdamage", | ||
"libxkbcommon", | ||
"libXrandr", | ||
"mesa-libgbm", | ||
"nss", | ||
"pango", | ||
]; | ||
|
||
const SUSE_BASED_DEPENDENT_PACKAGES = [ | ||
"libasound2", | ||
"libatk-1_0-0", | ||
"libatk-bridge-2_0-0", | ||
"libcups2", | ||
"libdbus-1-3", | ||
"libdrm2", | ||
"libgbm1", | ||
"libgobject-2_0-0", | ||
"libpango-1_0-0", | ||
"libXcomposite1", | ||
"libXdamage1", | ||
"libXfixes3", | ||
"libxkbcommon0", | ||
"libXrandr2", | ||
"mozilla-nss", | ||
]; | ||
|
||
const installDependencies = async (platform: Platform): Promise<void> => { | ||
if (platform.os !== "linux") { | ||
core.warning( | ||
`install-dependencies is only supported on Linux, but current platform is ${platform.os}`, | ||
); | ||
return; | ||
} | ||
|
||
const packages = await (async () => { | ||
const osReleaseId = await runtime.getOsReleaseId(); | ||
switch (osReleaseId) { | ||
case "rhel": | ||
case "centos": | ||
case "ol": | ||
case "fedora": | ||
return FEDORA_BASED_DEPENDENT_PACKAGES; | ||
case "debian": | ||
case "ubuntu": | ||
case "linuxmint": | ||
return DEBIAN_BASED_DEPENDENT_PACKAGES; | ||
case "opensuse": | ||
case "opensuse-leap": | ||
case "sles": | ||
return SUSE_BASED_DEPENDENT_PACKAGES; | ||
} | ||
throw new Error(`Unsupported OS: ${osReleaseId}`); | ||
})(); | ||
|
||
await pkg.install(packages); | ||
}; | ||
|
||
export { installDependencies }; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add sudo options here? Currently, we are getting Permission denied when apt-get update.
https://github.com/browser-actions/actions-swing/blob/1fb57b2dfdce6c0f1e3c15af0af169b63d989004/src/pkg/types.ts#L1-L3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting Permission denied when apt-get update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your report. I'm going to manage this issue at #544 (comment)