Compare commits

...

9 Commits

Author SHA1 Message Date
GitHub Actions 2f0cc07b4b Automation: update setup-beam version output to c36fc0c 2024-03-03 23:50:12 +00:00
Paulo F. Oliveira c36fc0ca1b Hack around rebar3 compiling your project to output its version (#256) 2024-03-03 17:49:50 -06:00
GitHub Actions 7c4882bbdd Automation: update setup-beam version output to cdb7a12 2024-03-03 23:49:23 +00:00
Paulo F. Oliveira cdb7a12eb6 Test on OTP-27.0-rc1 + a few minor README tweaks (#255) 2024-03-03 17:48:54 -06:00
GitHub Actions 904c511e63 Automation: update setup-beam version output to 4f55815 2024-02-29 22:37:38 +00:00
Jonatan Männchen 4f558159e6 Allow absolute version file paths (#258) 2024-02-29 22:37:17 +00:00
Paulo F. Oliveira 0430fb6cc6 Fix CI for pull requests (#259) 2024-02-29 22:03:16 +00:00
GitHub Actions 48f1d0ccc2 Automation: update setup-beam version output to 4ec4e80 2024-02-29 21:37:15 +00:00
github-actions[bot] 4ec4e80c33 Update 3rd party licenses (automation) (#257)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2024-02-29 21:36:50 +00:00
9 changed files with 101 additions and 36 deletions
+9 -1
View File
@@ -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
+8 -1
View File
@@ -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:
+11 -1
View File
@@ -1,7 +1,14 @@
---
name: ubuntu
on: [push, workflow_dispatch]
on:
push:
branches:
- main
pull_request:
branches:
- "*"
workflow_dispatch: {}
jobs:
integration_test:
@@ -15,6 +22,8 @@ jobs:
fail-fast: false
matrix:
combo:
- otp-version: 'OTP-27.0-rc1'
os: 'ubuntu-latest'
- otp-version: '26.0'
elixir-version: 'v1.14-otp-25'
os: 'ubuntu-latest'
@@ -174,6 +183,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}}
+11 -1
View File
@@ -1,7 +1,14 @@
---
name: windows
on: [push, workflow_dispatch]
on:
push:
branches:
- main
pull_request:
branches:
- "*"
workflow_dispatch: {}
jobs:
integration_test:
@@ -15,6 +22,8 @@ jobs:
fail-fast: false
matrix:
combo:
- otp-version: 'OTP-27.0-rc1'
os: 'windows-latest'
- otp-version: '26.0'
elixir-version: 'main'
os: 'windows-latest'
@@ -112,6 +121,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}}
+1 -1
View File
@@ -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.
+9 -9
View File
@@ -53,9 +53,9 @@ and Erlang/OTP.
|- |- |-
| ubuntu-18.04 | 17 - 25 | ✅
| ubuntu-20.04 | 20 - 25 | ✅
| ubuntu-22.04 | 24.2 - 25 | ✅
| ubuntu-22.04 | 24.2 - 26 | ✅
| windows-2019 | 21* - 25 | ✅
| windows-2022 | 21* - 25 | ✅
| windows-2022 | 21* - 26 | ✅
**Note** *: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3, 22.0, etc.
@@ -122,11 +122,11 @@ with the following correspondence.
#### `.tool-versions` format
| YML | `.tool-versions` |
|- |-
| `otp-version` | `erlang`
| `elixir-version` | `elixir`
| `gleam-version` | `gleam`
| `rebar3-version` | `rebar`
|- |- |
| `otp-version` | `erlang` |
| `elixir-version` | `elixir` |
| `gleam-version` | `gleam` |
| `rebar3-version` | `rebar` |
### Example (Erlang/OTP + Elixir, on Ubuntu)
@@ -248,7 +248,7 @@ jobs:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '25'
otp-version: '26'
# Use `cdn.jsdelivr.net/hex` as an alternative to `builds.hex.pm`
hexpm-mirrors: https://cdn.jsdelivr.net/hex
```
@@ -266,7 +266,7 @@ jobs:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: '25'
otp-version: '26'
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
+21 -11
View File
@@ -9885,7 +9885,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = 'eb31c4c'
const setupBeamVersion = 'c36fc0c'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -10422,7 +10422,7 @@ alongside ${alternativeName}=${alternativeValue} \
}
function parseVersionFile(versionFilePath0) {
const versionFilePath = path.join(
const versionFilePath = path.resolve(
process.env.GITHUB_WORKSPACE,
versionFilePath0,
)
@@ -10562,8 +10562,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'erl'
const args = ['-version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
win32: {
@@ -10579,8 +10580,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'erl.exe'
const args = ['+V']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -10608,8 +10610,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'elixir'
const args = ['-v']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -10648,8 +10651,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'gleam'
const args = ['--version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
win32: {
@@ -10681,8 +10685,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'gleam.exe'
const args = ['--version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -10713,8 +10718,12 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'rebar3'
const args = ['version']
const env = {
REBAR_GLOBAL_CONFIG_DIR: '/fake-dir',
REBAR_CONFIG: 'fake.config',
}
return [cmd, args]
return [cmd, args, env]
},
},
win32: {
@@ -10749,8 +10758,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'rebar3.cmd'
const args = ['version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -10804,8 +10814,8 @@ async function installTool(opts) {
core.exportVariable(installDirForVarName, runnerToolPath)
core.info(`Installed ${installOpts.tool} version`)
const [cmd, args] = platformOpts.reportVersion()
await exec(cmd, args)
const [cmd, args, env] = platformOpts.reportVersion()
await exec(cmd, args, { env: { ...process.env, ...env } })
}
function checkPlatform() {
+21 -11
View File
@@ -49,7 +49,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = 'eb31c4c'
const setupBeamVersion = 'c36fc0c'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -591,7 +591,7 @@ alongside ${alternativeName}=${alternativeValue} \
}
function parseVersionFile(versionFilePath0) {
const versionFilePath = path.join(
const versionFilePath = path.resolve(
process.env.GITHUB_WORKSPACE,
versionFilePath0,
)
@@ -731,8 +731,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'erl'
const args = ['-version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
win32: {
@@ -748,8 +749,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'erl.exe'
const args = ['+V']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -777,8 +779,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'elixir'
const args = ['-v']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -817,8 +820,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'gleam'
const args = ['--version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
win32: {
@@ -850,8 +854,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'gleam.exe'
const args = ['--version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -882,8 +887,12 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'rebar3'
const args = ['version']
const env = {
REBAR_GLOBAL_CONFIG_DIR: '/fake-dir',
REBAR_CONFIG: 'fake.config',
}
return [cmd, args]
return [cmd, args, env]
},
},
win32: {
@@ -918,8 +927,9 @@ async function install(toolName, opts) {
reportVersion: () => {
const cmd = 'rebar3.cmd'
const args = ['version']
const env = {}
return [cmd, args]
return [cmd, args, env]
},
},
}
@@ -973,8 +983,8 @@ async function installTool(opts) {
core.exportVariable(installDirForVarName, runnerToolPath)
core.info(`Installed ${installOpts.tool} version`)
const [cmd, args] = platformOpts.reportVersion()
await exec(cmd, args)
const [cmd, args, env] = platformOpts.reportVersion()
await exec(cmd, args, { env: { ...process.env, ...env } })
}
function checkPlatform() {
+10
View File
@@ -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 })
})