Skip to content

chore: Cherry-picked changes from upstream #324

chore: Cherry-picked changes from upstream

chore: Cherry-picked changes from upstream #324

Workflow file for this run

name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: |
npm install
- run: |
npm run all
test: # make sure the action works on a clean machine without building
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu
runs-on: ubuntu-latest
- name: macos
runs-on: macos-latest
- name: windows
runs-on: windows-latest
- name: alpine
runs-on: ubuntu-latest
container: alpine:latest
requirements: apk add --no-cache curl bash
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.container }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Install requirements
if: ${{ matrix.requirements }}
run: ${{ matrix.requirements }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup mise
uses: ./
with:
mise_toml: |
[tools]
jq = "1.7.1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mise --version
- run: mise x jq -- jq --version
- run: which jq
- run: jq --version
- run: . scripts/test.sh
shell: bash
specific_version:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup mise
uses: ./
with:
cache_save: ${{ github.ref_name == 'main' }}
cache_key_prefix: mise-v1
version: 2025.7.3
sha256: d38d4993c5379a680b50661f86287731dc1d1264777880a79b786403af337948
install_args: bun
mise_toml: |
[tools]
bun = "1"
- run: which bun
- run: bun -v
checksum_failure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mise
id: bad
uses: ./
with:
version: 2024.9.6
sha256: 1f0b8c3d2e4f5a6b7c8d9e0f1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t
continue-on-error: true
- name: Dump steps context
if: ${{ always() }}
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: expect failure
run: echo "Failed as expected"
if: ${{ steps.bad.outcome == 'failure' }}
- name: not failed as expected
run: |
echo "Expected failure but the job was ${{ steps.bad.outcome }}"
exit 1
if: ${{ steps.bad.outcome != 'failure' }}