mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-23 15:16:08 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 904c511e63 | |||
| 4f558159e6 | |||
| 0430fb6cc6 | |||
| 48f1d0ccc2 | |||
| 4ec4e80c33 | |||
| a23b1fc445 | |||
| eb31c4c998 | |||
| 726c8cb9ac | |||
| 951dd857ae | |||
| f2c1b65313 | |||
| 0352ab2e65 |
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: action
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
@@ -27,6 +34,7 @@ jobs:
|
||||
git add dist/index.js
|
||||
git commit -m "Automation: update setup-beam version output to ${SHA}"
|
||||
git push origin main
|
||||
|
||||
check_integrity:
|
||||
name: Expected local npm actions
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: hexpm-mirrors
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
test-failing-first-mirror:
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: ubuntu
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
integration_test:
|
||||
@@ -174,6 +181,7 @@ jobs:
|
||||
mix escript.install --force ${{matrix.combo.escript_packages}}
|
||||
${{matrix.combo.escript_script}}
|
||||
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
||||
|
||||
environment_variables:
|
||||
name: Environment variables
|
||||
runs-on: ${{matrix.combo.os}}
|
||||
@@ -199,7 +207,7 @@ jobs:
|
||||
- run: env
|
||||
- name: Check environment variables
|
||||
run: |
|
||||
${INSTALL_DIR_FOR_ELIXIR}/elixir --version
|
||||
${INSTALL_DIR_FOR_GLEAM}/gleam --version
|
||||
${INSTALL_DIR_FOR_OTP}/erl -version
|
||||
${INSTALL_DIR_FOR_REBAR3}/rebar3 version
|
||||
${INSTALL_DIR_FOR_ELIXIR}/bin/elixir -v
|
||||
${INSTALL_DIR_FOR_GLEAM}/bin/gleam --version
|
||||
${INSTALL_DIR_FOR_OTP}/bin/erl -version
|
||||
${INSTALL_DIR_FOR_REBAR3}/bin/rebar3 version
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
---
|
||||
name: windows
|
||||
|
||||
on: [push, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
integration_test:
|
||||
@@ -112,6 +119,7 @@ jobs:
|
||||
mix escript.install --force ${{matrix.combo.escript_packages}}
|
||||
${{matrix.combo.escript_script}}
|
||||
if: ${{matrix.combo.escript_packages && matrix.combo.escript_script}}
|
||||
|
||||
environment_variables:
|
||||
name: Environment variables
|
||||
runs-on: ${{matrix.combo.os}}
|
||||
@@ -137,8 +145,8 @@ jobs:
|
||||
- run: env
|
||||
- name: Check environment variables
|
||||
run: |
|
||||
${INSTALL_DIR_FOR_ELIXIR}/elixir --version
|
||||
${INSTALL_DIR_FOR_GLEAM}/gleam --version
|
||||
${INSTALL_DIR_FOR_OTP}/erl -version
|
||||
${INSTALL_DIR_FOR_REBAR3}/rebar3 version
|
||||
shell: bash
|
||||
& "$Env:INSTALL_DIR_FOR_ELIXIR/bin/elixir" "-v"
|
||||
& "$Env:INSTALL_DIR_FOR_GLEAM/bin/gleam.exe" "--version"
|
||||
& "$Env:INSTALL_DIR_FOR_OTP/bin/erl.exe" "+V"
|
||||
& "$Env:INSTALL_DIR_FOR_REBAR3/bin/rebar3.cmd" "version"
|
||||
& "$Env:INSTALL_DIR_FOR_REBAR3/bin/rebar3.ps1" "version"
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
node_modules/**
|
||||
dist/.github/workflows
|
||||
test/.tool-versions
|
||||
|
||||
+27
-1
@@ -118,7 +118,7 @@ THE SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: @fastify/busboy. A copy of the source code may be downloaded from https://github.com/fastify/busboy.git. This software contains the following license and notice below:
|
||||
The following software may be included in this product: @fastify/busboy. A copy of the source code may be downloaded from git+https://github.com/fastify/busboy.git. This software contains the following license and notice below:
|
||||
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
@@ -1566,6 +1566,32 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: es-define-property, es-errors. A copy of the source code may be downloaded from git+https://github.com/ljharb/es-define-property.git (es-define-property), git+https://github.com/ljharb/es-errors.git (es-errors). This software contains the following license and notice below:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Jordan Harband
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
-----
|
||||
|
||||
The following software may be included in this product: es6-error. A copy of the source code may be downloaded from https://github.com/bjyoungblood/es6-error.git. This software contains the following license and notice below:
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -282,6 +282,9 @@ environment variables:
|
||||
- `INSTALL_DIR_FOR_GLEAM`: base folder for Gleam
|
||||
- `INSTALL_DIR_FOR_REBAR3`: base folder for `rebar3`
|
||||
|
||||
In each of these you'll find folder `bin` where the appropriate binaries, platform-dependant,
|
||||
are found (i.e. `erl`, `erl.exe`, `rebar3`, `rebar3.exe`, ...).
|
||||
|
||||
## Elixir Problem Matchers
|
||||
|
||||
The Elixir Problem Matchers in this repository are adapted from
|
||||
|
||||
Vendored
+451
-433
File diff suppressed because it is too large
Load Diff
Generated
+515
-342
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -11,7 +11,9 @@
|
||||
"shellcheck": "shellcheck .github/workflows/*.sh",
|
||||
"test": "node test/setup-beam.test.js",
|
||||
"yamllint": "yamllint .github/workflows/**.yml && yamllint .*.yml && yamllint *.yml",
|
||||
"build-dist": "rm -rf ./dist && npm install && npm run build && npm run format && npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint"
|
||||
"clean-dist": "rm -rf ./dist",
|
||||
"lint": "npm run markdownlint && npm run shellcheck && npm run yamllint && npm run jslint",
|
||||
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.10.0",
|
||||
|
||||
+18
-11
@@ -49,7 +49,7 @@ async function main() {
|
||||
await maybeInstallRebar3(rebar3Spec)
|
||||
|
||||
// undefined is replaced by a function, post- main branch merge
|
||||
const setupBeamVersion = '6c8deb6'
|
||||
const setupBeamVersion = '4f55815'
|
||||
core.setOutput('setup-beam-version', setupBeamVersion)
|
||||
}
|
||||
|
||||
@@ -135,7 +135,6 @@ async function maybeInstallGleam(gleamSpec) {
|
||||
core.startGroup(`Installing Gleam ${gleamVersion}`)
|
||||
await install('gleam', { toolVersion: gleamVersion })
|
||||
core.setOutput('gleam-version', gleamVersion)
|
||||
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/gleam/bin`)
|
||||
core.endGroup()
|
||||
|
||||
installed = true
|
||||
@@ -156,7 +155,6 @@ async function maybeInstallRebar3(rebar3Spec) {
|
||||
core.startGroup(`Installing rebar3 ${rebar3Version}`)
|
||||
await install('rebar3', { toolVersion: rebar3Version })
|
||||
core.setOutput('rebar3-version', rebar3Version)
|
||||
core.addPath(`${process.env.RUNNER_TEMP}/.setup-beam/rebar3/bin`)
|
||||
core.endGroup()
|
||||
|
||||
installed = true
|
||||
@@ -593,7 +591,7 @@ alongside ${alternativeName}=${alternativeValue} \
|
||||
}
|
||||
|
||||
function parseVersionFile(versionFilePath0) {
|
||||
const versionFilePath = path.join(
|
||||
const versionFilePath = path.resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
versionFilePath0,
|
||||
)
|
||||
@@ -954,16 +952,25 @@ async function installTool(opts) {
|
||||
core.debug(` ... it is, at ${cachePath}`)
|
||||
}
|
||||
|
||||
core.debug('Performing post extract operations...')
|
||||
await platformOpts.postExtract(cachePath)
|
||||
// This makes sure we run, e.g. in Windows, the installer in the runner
|
||||
// We're not caching the install, just the downloaded tool
|
||||
const runnerToolPath = path.join(
|
||||
process.env.RUNNER_TEMP,
|
||||
'.setup-beam',
|
||||
toolName,
|
||||
)
|
||||
fs.cpSync(cachePath, runnerToolPath, { recursive: true })
|
||||
|
||||
core.debug(`Adding ${cachePath}'s bin to system path`)
|
||||
const catchPathBin = path.join(cachePath, 'bin')
|
||||
core.addPath(catchPathBin)
|
||||
core.debug('Performing post extract operations...')
|
||||
await platformOpts.postExtract(runnerToolPath)
|
||||
|
||||
core.debug(`Adding ${runnerToolPath}' bin to system path`)
|
||||
const runnerToolPathBin = path.join(runnerToolPath, 'bin')
|
||||
core.addPath(runnerToolPathBin)
|
||||
|
||||
const installDirForVarName = `INSTALL_DIR_FOR_${toolName}`.toUpperCase()
|
||||
core.debug(`Exporting ${installDirForVarName} as ${catchPathBin}`)
|
||||
core.exportVariable(installDirForVarName, catchPathBin)
|
||||
core.debug(`Exporting ${installDirForVarName} as ${runnerToolPath}`)
|
||||
core.exportVariable(installDirForVarName, runnerToolPath)
|
||||
|
||||
core.info(`Installed ${installOpts.tool} version`)
|
||||
const [cmd, args] = platformOpts.reportVersion()
|
||||
|
||||
@@ -8,6 +8,8 @@ simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
|
||||
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const core = require('@actions/core')
|
||||
const setupBeam = require('../src/setup-beam')
|
||||
const { problemMatcher } = require('../matchers/elixir-matchers.json')
|
||||
@@ -535,6 +537,14 @@ rebar ${rebar3}`
|
||||
assert.strictEqual(appVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(appVersions.get('elixir'), elixir)
|
||||
|
||||
const absoluteFilename = path.join(os.tmpdir(), '.tool-versions')
|
||||
fs.writeFileSync(absoluteFilename, toolVersions)
|
||||
|
||||
process.env.GITHUB_WORKSPACE = process.cwd()
|
||||
const absoluteAppVersions = setupBeam.parseVersionFile(absoluteFilename)
|
||||
assert.strictEqual(absoluteAppVersions.get('erlang'), erlang)
|
||||
assert.strictEqual(absoluteAppVersions.get('elixir'), elixir)
|
||||
|
||||
assert.ok(async () => {
|
||||
await setupBeam.install('otp', { toolVersion: erlang })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user