Compare commits

..

52 Commits

Author SHA1 Message Date
GitHub Actions ee09b1e59b Automation: update setup-beam version output to f8b54b5 2026-03-14 20:10:39 +00:00
Paulo F. Oliveira f8b54b559e Run ARM-specific tests consistently (#434)
* Run ARM-specific test consistently

* Fix for builds.hex.pm

https://builds.hex.pm/builds/otp/arm64/ubuntu-<x>.04/builds.txt

file is only available when <x> >= 20.

* Fix for builds.hex.pm

https://builds.hex.pm/builds/otp/arm64/ubuntu-20.04/builds.txt

does not contain Erlang 19 any more...
2026-03-14 20:10:19 +00:00
GitHub Actions bf1ce74034 Automation: update setup-beam version output to 559a930 2026-03-14 16:57:33 +00:00
dependabot[bot] 559a930751 Bump undici from 6.23.0 to 6.24.0 in the npm_and_yarn group across 1 directory (#432)
* Bump undici in the npm_and_yarn group across 1 directory

Bumps the npm_and_yarn group with 1 update in the / directory: [undici](https://github.com/nodejs/undici).


Updates `undici` from 6.23.0 to 6.24.0
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.23.0...v6.24.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.24.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>

* Help Dependabot (exec: npm run build-dist)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-14 16:57:11 +00:00
GitHub Actions 1380ebe712 Automation: update setup-beam version output to 0a54959 2026-03-14 16:50:39 +00:00
Sebastian Weddmark Olsson 0a549596b0 Compatibility matrix strategy (#389)
* Compatibility matrix strategy

Example on how one can maintain a compatibility matrix

* v2 -> v4

Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>

* ubuntu-18 not longer available

* Update README.md after review suggestions

* Link rebar3 compat

Apparently rebar3 has started to maintain a version compatability table themselves. Missing older versions though

| 3.10.0 | 17         |
| 3.11.1 | 18         |

* Tweak README change proposal

* Apply suggestions from code review

Apply changes to resolve linter warnings

Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>

---------

Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-14 16:50:22 +00:00
GitHub Actions 3a3c94fd9e Automation: update setup-beam version output to cfafb69 2026-03-14 16:43:34 +00:00
Daniel Widgren cfafb69ddd feat: add Erlang problem matchers (#433)
* feat: add Erlang problem matchers for erlc, dialyzer, CT, and EUnit

Adds GitHub Actions problem matchers for Erlang tooling, matching the
existing Elixir matcher support. Covers erlc errors/warnings (which
also catches dialyzer output), Common Test failures, and EUnit failures.

Closes #390

* chore: rebuild dist bundle and format test file

* refactor: move Erlang matchers into installOTP function

Moves maybeEnableErlangProblemMatchers() call inside installOTP(),
between setOutput and endGroup, matching the Elixir pattern.

* refactor: extract generic maybeEnableProblemMatchers function

Replaces separate maybeEnableErlangProblemMatchers and
maybeEnableElixirProblemMatchers with a single generic
maybeEnableProblemMatchers(language) and a problemMatchersEnabled()
helper.

* fix: use static paths for ncc to resolve matcher JSON files

ncc cannot trace dynamic template literals, so the matcher JSON files
were not being copied to dist/. Use a static map of paths instead.
2026-03-14 16:43:14 +00:00
GitHub Actions b3cbb6afbf Automation: update setup-beam version output to 2abe6cd 2026-03-14 16:30:13 +00:00
peter madsen-mygdal 2abe6cda7a fix: download correct Gleam binary for macOS and Linux ARM64 (#428)
The Gleam installer had two arch-related bugs:

1. Darwin reused the Linux config (installOpts.darwin = installOpts.linux),
   downloading x86_64-unknown-linux-musl on macOS, causing ENOEXEC.

2. Linux hardcoded x86_64, downloading the wrong binary on ARM64 runners,
   causing 'Syntax error' when trying to execute an x86_64 ELF.

Add arch detection via getRunnerOSArchitecture() to both Linux and
Darwin download URLs, selecting the correct aarch64 or x86_64 binary.
Add a proper Darwin config that downloads apple-darwin archives.
2026-03-14 16:29:49 +00:00
GitHub Actions d55fdba43f Automation: update setup-beam version output to eb86ad6 2026-03-14 16:29:25 +00:00
peter madsen-mygdal eb86ad6523 feat: add macOS-26 to supported ImageOS mappings (#430)
Add macos26 to the ImageOSToContainer map so runners using
macOS-26 are recognized instead of throwing an error.

Update macos.yml

Update README.md
2026-03-14 16:28:58 +00:00
GitHub Actions af6da5da48 Automation: update setup-beam version output to f018c1e 2026-03-13 23:46:13 +00:00
peter madsen-mygdal f018c1e6d8 fix: use dynamic import in tests to prevent ESM hoisting race (#429)
Static ESM imports are hoisted above top-level statements, causing
setup-beam.js to evaluate its main() guard before process.env.NODE_ENV
is set to 'test'. This triggered core.setFailed() during module load,
setting process.exitCode=1 and failing the test file even though all
individual test cases passed.

Switch setup-beam.js to a dynamic await import() so that the env and
input setup runs first, ensuring the NODE_ENV='test' guard works
correctly.

Amp-Thread-ID: https://ampcode.com/threads/T-019ce36a-a18f-7494-ac0a-c094a84f06ad

Co-authored-by: Amp <amp@ampcode.com>
2026-03-13 23:45:53 +00:00
GitHub Actions d843ebb78b Automation: update setup-beam version output to c8e0954 2026-03-11 17:47:37 +00:00
github-actions[bot] c8e09547a7 Update 3rd party licenses (automation) (#425)
Update 3rd party licenses

Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2026-03-11 17:47:17 +00:00
GitHub Actions 9d5b75ddfd Automation: update setup-beam version output to 98c13a9 2026-03-09 22:41:35 +00:00
Dino Kovač 98c13a9ed3 Support mise.toml (#415)
* add support for mise.toml version file type

* changes from review

* Keep versioning consistent

* fix default value for version-file-type input

* Use single `version-file`, autodetect type

* Update src/setup-beam.js

Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>

* Improve log output for mise version files

* Rebuild dist

* Run build-dist

* add support for mise.toml version file type

* changes from review

* Keep versioning consistent

* fix default value for version-file-type input

* Use single `version-file`, autodetect type

* Update src/setup-beam.js

Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>

* Improve log output for mise version files

* Rebuild dist

* Run build-dist

---------

Co-authored-by: Michael Ruoss <michael.ruoss@cradle.bio>
Co-authored-by: Michael Ruoss <michael@michaelruoss.ch>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-09 22:41:15 +00:00
GitHub Actions 0f13bcf18a Automation: update setup-beam version output to c3137f5 2026-03-09 22:19:29 +00:00
dependabot[bot] c3137f5cd5 Bump globals from 17.3.0 to 17.4.0 (#421)
* Bump globals from 17.3.0 to 17.4.0

Bumps [globals](https://github.com/sindresorhus/globals) from 17.3.0 to 17.4.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.3.0...v17.4.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 17.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Prevent Cannot access 'isStrictVersion' before initialization

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-09 22:19:11 +00:00
GitHub Actions 4cbacdb2a9 Automation: update setup-beam version output to 687000a 2026-03-09 22:10:23 +00:00
dependabot[bot] 687000ab96 Bump @actions/core from 1.11.1 to 3.0.0 (#419)
* Bump @actions/core from 1.11.1 to 3.0.0

Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.11.1 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* npm run build-dist

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-09 22:09:48 +00:00
dependabot[bot] 9ba6605098 Bump eslint-plugin-yml from 1.18.0 to 3.3.1 (#418)
* Bump eslint-plugin-yml from 1.18.0 to 3.3.1

Bumps [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) from 1.18.0 to 3.3.1.
- [Release notes](https://github.com/ota-meshi/eslint-plugin-yml/releases)
- [Changelog](https://github.com/ota-meshi/eslint-plugin-yml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ota-meshi/eslint-plugin-yml/compare/v1.18.0...v3.3.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-yml
  dependency-version: 3.3.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Help Dependabot

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-09 22:09:38 +00:00
GitHub Actions 722d91de6e Automation: update setup-beam version output to f79887d 2026-03-09 17:46:19 +00:00
dependabot[bot] f79887d1ba Bump eslint from 10.0.1 to 10.0.3 (#420)
Bumps [eslint](https://github.com/eslint/eslint) from 10.0.1 to 10.0.3.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v10.0.1...v10.0.3)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 10.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:44:31 +00:00
dependabot[bot] 30a0896082 Bump markdownlint-cli from 0.47.0 to 0.48.0 (#422)
Bumps [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) from 0.47.0 to 0.48.0.
- [Release notes](https://github.com/igorshubovych/markdownlint-cli/releases)
- [Commits](https://github.com/igorshubovych/markdownlint-cli/compare/v0.47.0...v0.48.0)

---
updated-dependencies:
- dependency-name: markdownlint-cli
  dependency-version: 0.48.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:44:08 +00:00
dependabot[bot] 41c0004487 Bump actions/setup-node from 6.2.0 to 6.3.0 (#423)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v6.2.0...v6.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:43:59 +00:00
dependabot[bot] 9fc15d548d Bump raven-actions/actionlint from 2.1.1 to 2.1.2 (#424)
Bumps [raven-actions/actionlint](https://github.com/raven-actions/actionlint) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/raven-actions/actionlint/releases)
- [Commits](https://github.com/raven-actions/actionlint/compare/v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: raven-actions/actionlint
  dependency-version: 2.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-09 17:43:51 +00:00
GitHub Actions 19003af5f4 Automation: update setup-beam version output to 53a564f 2026-03-07 14:40:30 +00:00
github-actions[bot] 53a564f4bb Update 3rd party licenses (automation) (#417)
Update 3rd party licenses

Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2026-03-07 14:40:09 +00:00
GitHub Actions 6ee130ce6b Automation: update setup-beam version output to 11a1f27 2026-03-06 20:46:44 +00:00
github-actions[bot] 11a1f27b1e Update 3rd party licenses (automation) (#416)
Update 3rd party licenses

Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2026-03-06 20:46:21 +00:00
GitHub Actions 83bf0e8bac Automation: update setup-beam version output to 47d6c3c 2026-03-03 17:18:10 +00:00
github-actions[bot] 47d6c3c4af Update 3rd party licenses (automation) (#414)
Update 3rd party licenses

Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2026-03-03 11:17:49 -06:00
GitHub Actions 0d2a6cb44d Automation: update setup-beam version output to 0f6ba5d 2026-03-03 04:07:24 +00:00
dependabot[bot] 0f6ba5d884 Bump @actions/tool-cache from 2.0.2 to 4.0.0 (#407)
* Bump @actions/tool-cache from 2.0.2 to 4.0.0

Bumps [@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache) from 2.0.2 to 4.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/tool-cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/cache@4.0.0/packages/tool-cache)

---
updated-dependencies:
- dependency-name: "@actions/tool-cache"
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Help Dependabot

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-03 04:07:06 +00:00
GitHub Actions 58166ce788 Automation: update setup-beam version output to 4a07ed8 2026-03-03 03:58:51 +00:00
dependabot[bot] 4a07ed84ac Bump @actions/exec from 1.1.1 to 3.0.0 (#405)
* Bump @actions/exec from 1.1.1 to 3.0.0

Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.1.1 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/exec)

---
updated-dependencies:
- dependency-name: "@actions/exec"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Modernize JS somewhat

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-03 03:58:30 +00:00
GitHub Actions de78da9a9d Automation: update setup-beam version output to 9928a16 2026-03-02 23:18:44 +00:00
github-actions[bot] 9928a16c11 Update 3rd party licenses (automation) (#413)
Update 3rd party licenses

Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2026-03-02 23:18:00 +00:00
GitHub Actions 3964390c66 Automation: update setup-beam version output to 1dacaf8 2026-03-02 23:14:32 +00:00
Paulo F. Oliveira 1dacaf8a01 Fix for license update automation (#412) 2026-03-02 23:14:13 +00:00
GitHub Actions fa8ba5f70e Automation: update setup-beam version output to daf8797 2026-03-02 22:09:05 +00:00
Paulo F. Oliveira daf8797d04 Update 3rd party licenses (#411)
Co-authored-by: GitHub Actions <actions@user.noreply.github.com>
2026-03-02 22:08:40 +00:00
GitHub Actions de72677f00 Automation: update setup-beam version output to 334f76c 2026-03-02 21:59:55 +00:00
dependabot[bot] 334f76ce04 Bump semver from 7.7.2 to 7.7.4 (#406)
* Bump semver from 7.7.2 to 7.7.4

Bumps [semver](https://github.com/npm/node-semver) from 7.7.2 to 7.7.4.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.7.2...v7.7.4)

---
updated-dependencies:
- dependency-name: semver
  dependency-version: 7.7.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Help Dependabot

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-02 21:59:33 +00:00
GitHub Actions 86b5ecbf21 Automation: update setup-beam version output to b8fc6e4 2026-03-02 21:34:07 +00:00
dependabot[bot] b8fc6e435e Bump @eslint/js from 9.38.0 to 10.0.1 (#404)
* Bump @eslint/js from 9.38.0 to 10.0.1

Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.38.0 to 10.0.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v10.0.1/packages/js)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 10.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Help Dependabot

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
2026-03-02 21:33:26 +00:00
GitHub Actions e7fda7af4e Automation: update setup-beam version output to a50e3e2 2026-03-02 21:22:09 +00:00
dependabot[bot] a50e3e2f89 Bump prettier from 3.6.2 to 3.8.1 (#408)
Bumps [prettier](https://github.com/prettier/prettier) from 3.6.2 to 3.8.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.6.2...3.8.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.8.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 21:21:18 +00:00
dependabot[bot] 7bc1e4ca67 Bump actions/setup-node from 6.1.0 to 6.2.0 (#409)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 21:21:10 +00:00
dependabot[bot] baf2bc3313 Bump raven-actions/actionlint from 2.1.0 to 2.1.1 (#410)
Bumps [raven-actions/actionlint](https://github.com/raven-actions/actionlint) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/raven-actions/actionlint/releases)
- [Commits](https://github.com/raven-actions/actionlint/compare/v2.1.0...v2.1.1)

---
updated-dependencies:
- dependency-name: raven-actions/actionlint
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 21:21:02 +00:00
15 changed files with 39555 additions and 14775 deletions
+29 -8
View File
@@ -46,7 +46,7 @@ jobs:
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-node@v6.1.0
- uses: actions/setup-node@v6.3.0
with:
node-version: '20'
- run: npm run build-dist
@@ -59,18 +59,25 @@ jobs:
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v6.0.2
- uses: raven-actions/actionlint@v2.1.0
- uses: raven-actions/actionlint@v2.1.2
unit_tests_ubuntu:
name: Unit tests (Ubuntu)
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-24.04-arm # ARM64
- ubuntu-latest # x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-node@v6.1.0
- uses: actions/setup-node@v6.3.0
with:
node-version: '20'
- run: npm ci
- run: npm test
env:
NODE_ENV: test
- name: .tool-versions test
id: setup-beam
uses: ./
@@ -82,14 +89,21 @@ jobs:
unit_tests_windows:
name: Unit tests (Windows)
runs-on: windows-latest
strategy:
matrix:
os:
- windows-11-arm # ARM64
- windows-latest # x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-node@v6.1.0
- uses: actions/setup-node@v6.3.0
with:
node-version: '20'
- run: npm install --production
- run: npm test
env:
NODE_ENV: test
- name: .tool-versions test
id: setup-beam
uses: ./
@@ -101,11 +115,18 @@ jobs:
unit_tests_macos:
name: Unit tests (macOS)
runs-on: macos-latest
strategy:
matrix:
os:
- macos-latest # ARM64
- macos-15-intel # x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-node@v6.1.0
- uses: actions/setup-node@v6.3.0
with:
node-version: '20'
- run: npm ci
- run: npm test
env:
NODE_ENV: test
+3
View File
@@ -45,6 +45,9 @@ jobs:
version-type: 'strict'
- otp-version: '25'
os: 'macos-15'
- otp-version: '27'
elixir-version: '1.18'
os: 'macos-26'
- otp-version: '26'
elixir-version: '1.16'
rebar3-version: '3.25'
@@ -3,6 +3,7 @@ name: Update 3rd party licenses (automation)
permissions:
contents: write
pull-requests: write
on:
schedule:
+4 -2
View File
@@ -1,2 +1,4 @@
node_modules/**
test/.tool-versions
/node_modules
/test/.tool-versions
/test/mise.toml
/dist/package.json
+1196 -6911
View File
File diff suppressed because it is too large Load Diff
+42 -8
View File
@@ -88,10 +88,16 @@ and Erlang/OTP.
| `macOS-13` | 25.0 - 28 | x86_64, arm64 | ✅
| `macOS-14` | 25.0 - 28 | x86_64, arm64 | ✅
| `macOS-15` | 25.0 - 28 | x86_64, arm64 | ✅
| `macOS-26` | 25.0 - 28 | x86_64, arm64 | ✅
**Note** \*: prior to 23, Windows builds are only available for minor versions, e.g. 21.0, 21.3,
22.0, etc.
### Compatibility between Erlang/OTP and rebar3
Check [version compatibility](https://github.com/erlang/rebar3?tab=readme-ov-file#compatibility-between-rebar3-and-erlangotp)
in `erlang/rebar3`.
### Self-hosted runners
Self-hosted runners need to set env. variable `ImageOS` to one of the following, since the action
@@ -107,6 +113,7 @@ uses that to download assets:
| `macos13` | `macOS-13`
| `macos14` | `macOS-14`
| `macos15` | `macOS-15`
| `macos26` | `macOS-26`
as per the following example:
@@ -141,23 +148,22 @@ e.g. `${{steps.setup-beam.outputs.erlang-version}}`
### Version file
A version file is specified via input `version-file` (e.g.`.tool-versions`). This
allows not having to use YML input for versions, though the action does check (and
A version file is specified via input `version-file` (e.g. `.tool-versions` or `mise.toml`).
The file type is inferred from the filename: files ending in `.toml` are parsed as
[mise](https://mise.jdx.dev/configuration.html#tools-dev-tools) configuration, and all others
are parsed as [`.tool-versions`](https://asdf-vm.com/manage/configuration.html) (asdf format).
This allows not having to use YML input for versions, though the action does check (and
will exit with error) if both inputs are set.
**Note**: if you're using a version file, option `version-type` is checked to be `strict`,
and will make the action exit with error otherwise.
The following version file formats are supported:
- `.tool-versions`, as specified by [asdf: Configuration](https://asdf-vm.com/manage/configuration.html)
Supported version elements are the same as the ones defined for the YML portion of the action,
with the following correspondence.
#### `.tool-versions` format
#### `.tool-versions` / `mise.toml` format
| YML | `.tool-versions`
| YML | Version file key
|- |-
| `otp-version` | `erlang`
| `elixir-version` | `elixir`
@@ -291,6 +297,34 @@ jobs:
- run: rebar3 ct
```
### Compatibility
To execute matrix testing with specific dependency versions, configure the environment matrix to
use pinned, compatible releases:
```yaml
test:
runs-on: ${{matrix.compat.os}}
name: Erlang/OTP ${{matrix.compat.otp}} / rebar3 ${{matrix.compat.rebar3}}
strategy:
matrix:
compat:
- otp: "26.2.5.5"
rebar3: "3.22.1"
os: ubuntu-24.04
- otp: "27.1.2"
rebar3: "3.22.1"
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.compat.otp}}
rebar3-version: ${{matrix.compat.rebar3}}
version-type: strict
- run: rebar3 eunit
```
### Erlang/OTP + `rebar3`, on Windows
```yaml
+3 -1
View File
@@ -69,7 +69,9 @@ inputs:
required: false
version-file:
description: a versions file (e.g. as used by `asdf`), which defines inputs
description: >-
a versions file (e.g. `.tool-versions` as used by `asdf`, or `mise.toml`
as used by `mise`), which defines inputs
default: ''
required: false
+66
View File
@@ -0,0 +1,66 @@
{
"problemMatcher": [
{
"owner": "erlc-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(\\S+):(\\d+):(\\d+): [wW]arning: (.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "erlc-error",
"severity": "error",
"pattern": [
{
"regexp": "^(\\S+):(\\d+):(\\d+): (?![wW]arning)(.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "ct-failure",
"severity": "error",
"pattern": [
{
"regexp": "^(\\S+) failed on line (\\d+)$",
"file": 1,
"line": 2
},
{
"regexp": "^Reason: (.+)$",
"message": 1
}
]
},
{
"owner": "eunit-failure",
"severity": "error",
"pattern": [
{
"regexp": "^\\S+: .+\\.\\.\\.\\*failed\\*$"
},
{
"regexp": "^in function .+ \\((.+), line (\\d+)\\)$",
"file": 1,
"line": 2
},
{
"regexp": "^in call from .+$"
},
{
"regexp": "^\\*\\*error:(.+)$",
"message": 1
}
]
}
]
}
+36821 -7027
View File
File diff suppressed because one or more lines are too long
+19 -22
View File
@@ -1,30 +1,27 @@
import js from '@eslint/js'
import globals from 'globals'
import { defineConfig } from 'eslint/config'
import eslintPluginYml from 'eslint-plugin-yml'
import yml from 'eslint-plugin-yml'
import * as yamlParser from 'yaml-eslint-parser'
export default defineConfig([
...eslintPluginYml.configs['flat/recommended'],
export default [
js.configs.recommended,
{
extends: ['js/recommended'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: globals.node,
},
},
{
files: ['**/*.yml'],
languageOptions: {
parser: yamlParser,
},
plugins: {
js,
yml,
},
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.node,
},
rules: {
...yml.configs.recommended.rules,
},
},
{
extends: eslintPluginYml.configs['flat/recommended'],
files: ['*.yml'],
languageOptions: {
parserOptions: {
parser: 'yaml-eslint-parser',
defaultYAMLVersion: '1.2',
},
},
},
])
]
+66
View File
@@ -0,0 +1,66 @@
{
"problemMatcher": [
{
"owner": "erlc-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(\\S+):(\\d+):(\\d+): [wW]arning: (.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "erlc-error",
"severity": "error",
"pattern": [
{
"regexp": "^(\\S+):(\\d+):(\\d+): (?![wW]arning)(.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "ct-failure",
"severity": "error",
"pattern": [
{
"regexp": "^(\\S+) failed on line (\\d+)$",
"file": 1,
"line": 2
},
{
"regexp": "^Reason: (.+)$",
"message": 1
}
]
},
{
"owner": "eunit-failure",
"severity": "error",
"pattern": [
{
"regexp": "^\\S+: .+\\.\\.\\.\\*failed\\*$"
},
{
"regexp": "^in function .+ \\((.+), line (\\d+)\\)$",
"file": 1,
"line": 2
},
{
"regexp": "^in call from .+$"
},
{
"regexp": "^\\*\\*error:(.+)$",
"message": 1
}
]
}
]
}
+1014 -714
View File
File diff suppressed because it is too large Load Diff
+12 -10
View File
@@ -1,5 +1,6 @@
{
"name": "setup-beam",
"type": "module",
"license": "MIT",
"private": true,
"scripts": {
@@ -16,21 +17,22 @@
"build-dist": "npm run clean-dist && npm install && npm run build && npm run format && npm run lint"
},
"dependencies": {
"@actions/core": "1.11.1",
"@actions/exec": "1.1.1",
"@actions/tool-cache": "2.0.2",
"@actions/core": "3.0.0",
"@actions/exec": "3.0.0",
"@actions/tool-cache": "4.0.0",
"csv-parse": "6.1.0",
"lodash": "4.17.23",
"semver": "7.7.2"
"semver": "7.7.4",
"toml": "3.0.0"
},
"devDependencies": {
"@eslint/js": "9.38.0",
"@eslint/js": "10.0.1",
"@vercel/ncc": "0.38.4",
"eslint": "9.38.0",
"eslint-plugin-yml": "1.18.0",
"globals": "17.3.0",
"markdownlint-cli": "0.47.0",
"prettier": "3.6.2",
"eslint": "10.0.3",
"eslint-plugin-yml": "3.3.1",
"globals": "17.4.0",
"markdownlint-cli": "0.48.0",
"prettier": "3.8.1",
"shellcheck": "4.1.0",
"yarn": "1.22.22"
},
+100 -44
View File
@@ -1,14 +1,19 @@
const core = require('@actions/core')
const { exec } = require('@actions/exec')
const tc = require('@actions/tool-cache')
const path = require('path')
const semver = require('semver')
const fs = require('fs')
const os = require('os')
const csv = require('csv-parse/sync')
const _ = require('lodash')
import path from 'node:path'
import fs from 'node:fs'
import os from 'node:os'
import { fileURLToPath } from 'node:url'
import * as core from '@actions/core'
import { exec } from '@actions/exec'
import * as tc from '@actions/tool-cache'
import * as semver from 'semver'
import * as csv from 'csv-parse/sync'
import _ from 'lodash'
import toml from 'toml'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const MAX_HTTP_RETRIES = 3
const APPS = ['erlang', 'elixir', 'gleam', 'rebar']
if (process.env.NODE_ENV !== 'test') {
main().catch((err) => {
@@ -53,7 +58,7 @@ async function main() {
await maybeInstallRebar3(rebar3Spec)
// undefined is replaced by a function, post- main branch merge
const setupBeamVersion = 'fe5485f'
const setupBeamVersion = 'f8b54b5'
core.setOutput('setup-beam-version', setupBeamVersion)
}
@@ -75,6 +80,7 @@ async function installOTP(otpSpec) {
},
})
core.setOutput('otp-version', otpVersion)
maybeEnableProblemMatchers('erlang')
core.endGroup()
return otpVersion
@@ -96,7 +102,7 @@ async function maybeInstallElixir(elixirSpec) {
},
})
core.setOutput('elixir-version', elixirVersion)
maybeEnableElixirProblemMatchers()
maybeEnableProblemMatchers('elixir')
core.endGroup()
installed = true
@@ -105,16 +111,18 @@ async function maybeInstallElixir(elixirSpec) {
return installed
}
function maybeEnableElixirProblemMatchers() {
const disableProblemMatchers = getInput('disable_problem_matchers', false)
if (disableProblemMatchers === 'false') {
const elixirMatchers = path.join(
__dirname,
'..',
'matchers',
'elixir-matchers.json',
)
core.info(`##[add-matcher]${elixirMatchers}`)
function problemMatchersEnabled() {
return getInput('disable_problem_matchers', false) === 'false'
}
// path.join with static strings helps ncc resolve and bundle the JSON files
function maybeEnableProblemMatchers(language) {
if (problemMatchersEnabled()) {
const matcherFiles = {
erlang: path.join(`${__dirname}/../matchers/erlang-matchers.json`),
elixir: path.join(`${__dirname}/../matchers/elixir-matchers.json`),
}
core.info(`##[add-matcher]${matcherFiles[language]}`)
}
}
@@ -191,17 +199,17 @@ async function getOTPVersion(otpSpec0, osVersion) {
}
function requestedVersionFor(tool, version, originListing, mirrors) {
const isStrictVersion = isStrictVersion()
const isVersionTypeStrict = isStrictVersion()
let versionType = 'loose'
if (isStrictVersion) {
if (isVersionTypeStrict) {
versionType = 'strict'
}
let ret =
`Requested ${versionType} ${tool} version (${version}) not found in version list, ` +
`at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.`
if (!isStrictVersion) {
if (!isVersionTypeStrict) {
ret = `${ret} Should you be using option 'version-type': 'strict'?`
}
@@ -576,7 +584,7 @@ function getVersionFromSpec(spec0, versions0) {
}
function maybeCoerced(v) {
let ret = null
let ret
try {
if (!isRC(v)) {
ret = semver.coerce(v).version
@@ -662,6 +670,7 @@ function getRunnerOSVersion() {
macos13: 'macOS-13',
macos14: 'macOS-14',
macos15: 'macOS-15',
macos26: 'macOS-26',
}
const deprecatedImageOSToContainer = {
ubuntu18: 'ubuntu-18.04',
@@ -801,28 +810,14 @@ alongside ${alternativeName}=${alternativeValue} \
return input
}
function parseVersionFile(versionFilePath0) {
const versionFilePath = path.resolve(
process.env.GITHUB_WORKSPACE,
versionFilePath0,
)
if (!fs.existsSync(versionFilePath)) {
throw new Error(
`The specified version file, ${versionFilePath0}, does not exist`,
)
}
core.startGroup(`Parsing version file at ${versionFilePath0}`)
function parseToolVersionsFile(versionFilePath) {
const appVersions = new Map()
const versions = fs.readFileSync(versionFilePath, 'utf8')
// For the time being we parse .tool-versions
// If we ever start parsing something else, this should
// become default in a new option named e.g. version-file-type
versions.split(/\r?\n/).forEach((line) => {
const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/)
if (appVersion) {
const app = appVersion[1]
if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) {
if (APPS.includes(app)) {
const [, , , version] = appVersion
core.info(`Consuming ${app} at version ${version}`)
appVersions.set(app, version)
@@ -839,6 +834,46 @@ function parseVersionFile(versionFilePath0) {
return appVersions
}
function parseMiseTomlFile(versionFilePath) {
const appVersions = new Map()
const miseToml = fs.readFileSync(versionFilePath, 'utf8')
const miseTomlParsed = toml.parse(miseToml)
for (const app in miseTomlParsed.tools) {
if (APPS.includes(app)) {
const appVersion = miseTomlParsed.tools[app]
const version =
typeof appVersion == 'object' ? appVersion.version : appVersion
core.info(`Consuming ${app} at version ${version}`)
appVersions.set(app, version)
}
}
return appVersions
}
function parseVersionFile(versionFilePath0) {
const versionFilePath = path.resolve(
process.env.GITHUB_WORKSPACE,
versionFilePath0,
)
if (!fs.existsSync(versionFilePath)) {
throw new Error(
`The specified version file, ${versionFilePath0}, does not exist`,
)
}
if (versionFilePath0.endsWith('.toml')) {
core.startGroup(
`Parsing ${path.basename(versionFilePath0)} file at ${versionFilePath0}`,
)
return parseMiseTomlFile(versionFilePath)
}
core.startGroup(`Parsing .tool-versions file at ${versionFilePath0}`)
return parseToolVersionsFile(versionFilePath)
}
function debugLog(groupName, message) {
const group = `Debugging for ${groupName}`
core.debug(
@@ -1021,12 +1056,14 @@ async function install(toolName, opts) {
tool: 'Gleam',
linux: {
downloadToolURL: () => {
const arch = getRunnerOSArchitecture()
let gz
if (
versionSpec === 'nightly' ||
semver.gt(versionSpec, 'v0.22.1')
) {
gz = `gleam-${versionSpec}-x86_64-unknown-linux-musl.tar.gz`
const target = arch === 'arm64' ? 'aarch64' : 'x86_64'
gz = `gleam-${versionSpec}-${target}-unknown-linux-musl.tar.gz`
} else {
gz = `gleam-${versionSpec}-linux-amd64.tar.gz`
}
@@ -1090,7 +1127,26 @@ async function install(toolName, opts) {
},
},
}
installOpts.darwin = installOpts.linux
installOpts.darwin = {
downloadToolURL: () => {
const arch = getRunnerOSArchitecture()
let gz
if (versionSpec === 'nightly' || semver.gt(versionSpec, 'v0.22.1')) {
const target = arch === 'arm64' ? 'aarch64' : 'x86_64'
gz = `gleam-${versionSpec}-${target}-apple-darwin.tar.gz`
} else {
gz =
arch === 'arm64'
? `gleam-${versionSpec}-macos-arm64.tar.gz`
: `gleam-${versionSpec}-macos.tar.gz`
}
return `https://github.com/gleam-lang/gleam/releases/download/${versionSpec}/${gz}`
},
extract: installOpts.linux.extract,
postExtract: installOpts.linux.postExtract,
reportVersion: installOpts.linux.reportVersion,
}
break
case 'rebar3':
installOpts = {
@@ -1237,7 +1293,7 @@ function debugLoggingEnabled() {
return !!process.env.RUNNER_DEBUG
}
module.exports = {
export default {
get,
getElixirVersion,
getGleamVersion,
+179 -28
View File
@@ -1,3 +1,15 @@
import assert from 'node:assert'
import http from 'node:http'
import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
import { describe, it } from 'node:test'
import * as csv from 'csv-parse/sync'
import elixirMatchers from '../matchers/elixir-matchers.json' with { type: 'json' }
import erlangMatchers from '../matchers/erlang-matchers.json' with { type: 'json' }
const { problemMatcher } = elixirMatchers
const { problemMatcher: erlangProblemMatcher } = erlangMatchers
process.env.NODE_ENV = 'test'
simulateInput('otp-version', '25.1.2')
@@ -9,15 +21,7 @@ simulateInput('install-hex', 'true')
simulateInput('github-token', process.env.GITHUB_TOKEN)
simulateInput('hexpm-mirrors', 'https://builds.hex.pm', { multiline: true })
const assert = require('assert')
const http = require('http')
const fs = require('fs')
const os = require('os')
const path = require('path')
const setupBeam = require('../src/setup-beam')
const { problemMatcher } = require('../matchers/elixir-matchers.json')
const { describe, it } = require('node:test')
const csv = require('csv-parse/sync')
const { default: setupBeam } = await import('../src/setup-beam.js')
const matrix = {
otp: {
@@ -173,11 +177,8 @@ describe('.getOTPVersion(_) - Erlang', () => {
'https://repo.hex.pm, https://cdn.jsdelivr.net/hex',
{ multiline: true },
)
const previousRunnerArch = process.env.RUNNER_ARCH
if (process.platform === 'linux') {
process.env.RUNNER_ARCH = 'X64'
it('is Ok for known linux version', async () => {
before = simulateInput('version-type', 'strict')
spec = '27.0'
@@ -195,21 +196,21 @@ describe('.getOTPVersion(_) - Erlang', () => {
assert.deepStrictEqual(got, expected)
simulateInput('version-type', before)
spec = '19.3.x'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6.13'
spec = '20.3.x'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8.26'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
spec = '^19.3.6'
osVersion = 'ubuntu-16.04'
expected = 'OTP-19.3.6.13'
spec = '^20.3.8'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8.26'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
spec = '^19.3'
osVersion = 'ubuntu-18.04'
expected = 'OTP-19.3.6.13'
spec = '^20.3'
osVersion = 'ubuntu-20.04'
expected = 'OTP-20.3.8.26'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
@@ -305,6 +306,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
if (process.platform === 'linux') {
it('is main-... only if strict/maint-... is used as input', async () => {
const arm64Options = setupBeam.githubARMRunnerArchs()
const previousRunnerArch = process.env.RUNNER_ARCH
process.env.RUNNER_ARCH =
arm64Options[Math.floor(Math.random() * arm64Options.length)]
@@ -340,6 +342,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
it('is Ok for known linux ARM64 version', async () => {
const arm64Options = setupBeam.githubARMRunnerArchs()
const previousRunnerArch = process.env.RUNNER_ARCH
process.env.RUNNER_ARCH =
arm64Options[Math.floor(Math.random() * arm64Options.length)]
@@ -400,10 +403,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
expected = 'master'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
process.env.RUNNER_ARCH = previousRunnerArch
})
it('is Ok for known linux AMD64 version', async () => {
const amd64Options = setupBeam.githubAMDRunnerArchs()
const previousRunnerArch = process.env.RUNNER_ARCH
process.env.RUNNER_ARCH =
amd64Options[Math.floor(Math.random() * amd64Options.length)]
@@ -482,12 +488,15 @@ describe('.getOTPVersion(_) - Erlang', () => {
expected = 'master'
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
process.env.RUNNER_ARCH = previousRunnerArch
})
}
if (process.platform === 'darwin') {
it('is main-... only if strict/maint-... is used as input', async () => {
const arm64Options = setupBeam.githubARMRunnerArchs()
const previousRunnerArch = process.env.RUNNER_ARCH
process.env.RUNNER_ARCH =
arm64Options[Math.floor(Math.random() * arm64Options.length)]
@@ -517,6 +526,7 @@ describe('.getOTPVersion(_) - Erlang', () => {
it('is Ok for known macos ARM64 version', async () => {
const arm64Options = setupBeam.githubARMRunnerArchs()
const previousRunnerArch = process.env.RUNNER_ARCH
process.env.RUNNER_ARCH =
arm64Options[Math.floor(Math.random() * arm64Options.length)]
@@ -527,10 +537,13 @@ describe('.getOTPVersion(_) - Erlang', () => {
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
simulateInput('version-type', before)
process.env.RUNNER_ARCH = previousRunnerArch
})
it('is Ok for known macos AMD64 version', async () => {
const amd64Options = setupBeam.githubARMRunnerArchs()
const previousRunnerArch = process.env.RUNNER_ARCH
process.env.RUNNER_ARCH =
amd64Options[Math.floor(Math.random() * amd64Options.length)]
@@ -541,11 +554,12 @@ describe('.getOTPVersion(_) - Erlang', () => {
got = await setupBeam.getOTPVersion(spec, osVersion)
assert.deepStrictEqual(got, expected)
simulateInput('version-type', before)
process.env.RUNNER_ARCH = previousRunnerArch
})
}
simulateInput('hexpm-mirrors', hexMirrors, { multiline: true })
process.env.RUNNER_ARCH = previousRunnerArch
})
describe('OTP arch-specific install', () => {
@@ -568,6 +582,7 @@ describe('OTP arch-specific install', () => {
`Fetching OTP Version with invalid Github runner architecture is supposed to fail`,
)
}
process.env.RUNNER_ARCH = previousRunnerArch
})
})
@@ -578,11 +593,8 @@ describe('.getOTPVersion(_) - Elixir', () => {
let spec
let otpVersion
let before
const previousRunnerArch = process.env.RUNNER_ARCH
if (process.platform === 'linux') {
process.env.RUNNER_ARCH = 'X64'
it('returns the expected value', async () => {
spec = '1.18.x'
otpVersion = 'OTP-27'
@@ -640,8 +652,6 @@ describe('.getOTPVersion(_) - Elixir', () => {
simulateInput('version-type', before)
})
}
process.env.RUNNER_ARCH = previousRunnerArch
})
describe('.getOTPVersion(_) - Gleam', () => {
@@ -968,7 +978,7 @@ describe('.getVersionFromSpec(_)', () => {
})
})
describe('version file', () => {
describe('.tool-versions file', () => {
const otpVersion = unsimulateInput('otp-version')
const elixirVersion = unsimulateInput('elixir-version')
const gleamVersion = unsimulateInput('gleam-version')
@@ -1017,6 +1027,55 @@ gleam ${gleam} \n`
simulateInput('gleam-version', gleamVersion)
})
describe('mise.toml file', () => {
const otpVersion = unsimulateInput('otp-version')
const elixirVersion = unsimulateInput('elixir-version')
const gleamVersion = unsimulateInput('gleam-version')
it('is parsed correctly', async () => {
const erlang = '27.3.4.1'
const elixir = '1.18.4'
const gleam = '1.9.1'
let miseToml = `[tools]
"erlang" = "${erlang}"
elixir = { version = "${elixir}", postinstall="mix deps.get" } # comment, with space and ref:
"not-gleam" = 0.23 # not picked up
"gleam" = "${gleam}" \n`
const filename = 'test/mise.toml'
if (process.platform === 'win32') {
// Force \r\n to test in Windows
miseToml = miseToml.replace(/\n/g, '\r\n')
}
fs.writeFileSync(filename, miseToml)
process.env.GITHUB_WORKSPACE = ''
const appVersions = setupBeam.parseVersionFile(filename)
assert.strictEqual(appVersions.get('erlang'), erlang)
assert.strictEqual(appVersions.get('elixir'), elixir)
const absoluteFilename = path.join(os.tmpdir(), 'mise.toml')
fs.writeFileSync(absoluteFilename, miseToml)
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 })
})
assert.ok(async () => {
await setupBeam.install('elixir', { toolVersion: elixir })
})
assert.ok(async () => {
await setupBeam.install('gleam', { toolVersion: gleam })
})
})
simulateInput('otp-version', otpVersion)
simulateInput('elixir-version', elixirVersion)
simulateInput('gleam-version', gleamVersion)
})
describe('.get(_)', () => {
it('retries as expected', async () => {
let attempt = 0
@@ -1108,6 +1167,98 @@ describe("Elixir Mix matcher's", () => {
})
})
describe("Erlang matcher's", () => {
it('erlc errors are properly matched', () => {
const [matcher] = erlangProblemMatcher.find(
({ owner }) => owner === 'erlc-error',
).pattern
const output = 'src/mymod.erl:42:5: head mismatch'
const match = output.match(matcher.regexp)
assert.equal(match[1], 'src/mymod.erl')
assert.equal(match[2], '42')
assert.equal(match[3], '5')
assert.equal(match[4], 'head mismatch')
})
it('erlc errors do not match warnings', () => {
const [matcher] = erlangProblemMatcher.find(
({ owner }) => owner === 'erlc-error',
).pattern
const output = 'src/mymod.erl:42:5: Warning: variable X is unused'
const match = output.match(matcher.regexp)
assert.equal(match, null)
})
it('erlc warnings are properly matched', () => {
const [matcher] = erlangProblemMatcher.find(
({ owner }) => owner === 'erlc-warning',
).pattern
const output = 'src/mymod.erl:10:3: Warning: variable X is unused'
const match = output.match(matcher.regexp)
assert.equal(match[1], 'src/mymod.erl')
assert.equal(match[2], '10')
assert.equal(match[3], '3')
assert.equal(match[4], 'variable X is unused')
})
it('dialyzer warnings are matched via erlc patterns', () => {
const [matcher] = erlangProblemMatcher.find(
({ owner }) => owner === 'erlc-warning',
).pattern
const output =
'src/mymod.erl:25:1: warning: Function foo/0 has no local return'
const match = output.match(matcher.regexp)
assert.equal(match[1], 'src/mymod.erl')
assert.equal(match[2], '25')
assert.equal(match[3], '1')
assert.equal(match[4], 'Function foo/0 has no local return')
})
it('CT failures are properly matched', () => {
const [filePattern, reasonPattern] = erlangProblemMatcher.find(
({ owner }) => owner === 'ct-failure',
).pattern
const firstOutput = 'test/mymod_SUITE.erl failed on line 55'
const secondOutput = 'Reason: {badmatch,{error,timeout}}'
const fileMatch = firstOutput.match(filePattern.regexp)
assert.equal(fileMatch[1], 'test/mymod_SUITE.erl')
assert.equal(fileMatch[2], '55')
const reasonMatch = secondOutput.match(reasonPattern.regexp)
assert.equal(reasonMatch[1], '{badmatch,{error,timeout}}')
})
it('EUnit failures are properly matched', () => {
const [headerPattern, funcPattern, callPattern, errorPattern] =
erlangProblemMatcher.find(
({ owner }) => owner === 'eunit-failure',
).pattern
const header = 'mymod_test: hello_test....*failed*'
const func =
'in function mymod_test:hello_test/0 (test/mymod_test.erl, line 12)'
const call = 'in call from mymod_test:hello_test/0'
const error = '**error:{badmatch,false}'
assert.ok(header.match(headerPattern.regexp))
const funcMatch = func.match(funcPattern.regexp)
assert.equal(funcMatch[1], 'test/mymod_test.erl')
assert.equal(funcMatch[2], '12')
assert.ok(call.match(callPattern.regexp))
const errorMatch = error.match(errorPattern.regexp)
assert.equal(errorMatch[1], '{badmatch,false}')
})
})
function unsimulateInput(key) {
return simulateInput(key, '')
}