Files
setup-beam/.github/workflows/action.yml
T
Paulo F. Oliveira 6e9312bce0 fix: broken tests (mostly out of stuff being outdated) (#468)
* Update rebar3's releases.json per current results

* Up rebar3 test versions

* Retire windows-2019

* Add "support" to win25-vs2026 next to win25

windows-2025-vs2026 label was previously a beta testing
tag but is now the production default

* Fix rebar3 test releases.json

* Bump per CI results

* Fix per CI results (I checked in releases.json)

* Adapt to Ubuntu 26.04 (no -arm)

* Consider Ubuntu ARM variants in execution

* Typo

* Bump it to the minimum expect value

* Bump it to the minimum expect value

* Tweak ARM tests: drop windows-11

* Fix per prior test results

* Try testing OTP to update README

* Improve guarantees on the README (via tests)

* Improve guarantees on the README (via tests)

Trust tests in intervals (if first Ok and last Ok the middle Ok)

* Add further constraints for testing (per README)

* Remove moving-target test

This is prone to fail for an issue with OTP's main
branch but it shouldn't affect the action, so we
remove it

* Respect Hex's boundaries

* Make it consistent (no need for .0 in versioning)

* Restrict it a bit

We keep the README as-is, since there's nothing preventing us
from thinking it works as stated, but we move our tests forward

* Make it easier to follow

* Fix it per stalled CI

* Fix it: no macos-16; it's macos-26

* Deprecate macos-13

Per https://github.blog/changelog/2025-07-11-upcoming-changes-to-macos-hosted-runners-macos-latest-migration-and-xcode-support-policy-updates/#macos-13-is-closing-down

* Make ImageOS support more explicit

* Move forward
2026-06-28 15:53:20 +01:00

132 lines
3.2 KiB
YAML

---
name: action
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
branches:
- '*'
workflow_dispatch: {}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
version:
name: Version with commit unique id
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@v6.0.2
- name: Version it!
run: |
# We expect a string such as const setupBeamVersion = 'undefined' in the code
SHA=$(git rev-parse --short HEAD)
sed -i'.bak' \
-e "s/const setupBeamVersion = '.*'/const setupBeamVersion = '${SHA}'/g" \
src/setup-beam.js
npm run build-dist
git config user.name "GitHub Actions"
git config user.email "actions@user.noreply.github.com"
git add src/setup-beam.js
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
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-node@v6.3.0
with:
node-version: '24'
- run: npm run build-dist
- name: Check if build left artifacts
run: git diff --exit-code --ignore-space-at-eol
check_action:
name: Action
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v6.0.2
- uses: raven-actions/actionlint@v2.1.2
unit_tests_ubuntu:
name: Unit tests (Ubuntu)
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.3.0
with:
node-version: '24'
- run: npm ci
- run: npm test
env:
NODE_ENV: test
- name: .tool-versions test
id: setup-beam
uses: ./
with:
install-rebar: false
install-hex: false
version-file: test/.tool-versions
version-type: strict
unit_tests_windows:
name: Unit tests (Windows)
strategy:
matrix:
os:
- windows-latest # x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-node@v6.3.0
with:
node-version: '24'
- run: npm install --production
- run: npm test
env:
NODE_ENV: test
- name: .tool-versions test
id: setup-beam
uses: ./
with:
install-rebar: false
install-hex: false
version-file: test/.tool-versions
version-type: strict
unit_tests_macos:
name: Unit tests (macOS)
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.3.0
with:
node-version: '24'
- run: npm ci
- run: npm test
env:
NODE_ENV: test