mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-22 22:56:07 +00:00
d5f3979a5f
Update the action runtime, engine constraint, and CI workflow pins from Node 20 to Node 24 per GitHub's guidance on the deprecation of Node 20 on GitHub Actions runners: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
133 lines
3.2 KiB
YAML
133 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-11-arm # ARM64
|
|
- 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
|