diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..44622c8 --- /dev/null +++ b/action.yaml @@ -0,0 +1,39 @@ +name: 'Setup Browser' +description: | + Installs a browser from various sources to use for tests. + Are supported: + + - Ungoogled Chromium (`uchromium`), aailable versions are listed [here](https://ungoogled-software.github.io/ungoogled-chromium-binaries/releases/appimage/64bit/) +inputs: + target: + description: | + The browser and ersion to install in the form `BROWSER:VERSION`. + The version is optional. + required: true + install-path: + description: | + The path where the binary should be installed. + The path is added to the system PATH for subsequent steps. +runs: + using: "composite" + steps: + - name: Download setup-browser + working-directory: ${{ github.action_path }} + run: | + wget -q https://code.bcarlin.net/actions/setup-browser/releases/download/latest/setup-browser + chmod +x setup-browser + shell: bash + + - name: Download the browser + working-directory: ${{ github.action_path }} + run: | + INSTALL_PATH=${INSTALL_PATH:-/opt/${TARGET%%:*}} + ./setup-browser install \ + -cache-path cache \ + -install-to "$INSTALL_PATH" \ + ${{ inputs.target }} + echo "$(dirname "$INSTALL_PATH")" >> "$GITHUB_PATH" + shell: bash + env: + TARGET: ${{ inputs.target }} + INSTALL_PATH: ${{ inputs.install-path }}