Skip to content

Commit

Permalink
Bump rhysd/actionlint from 1.6.27 to 1.7.0 (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabasoad authored May 15, 2024
1 parent 7527747 commit bce27e7
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 22 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
name: Functional Tests

on:
pull_request: {}
push:
branches:
- "main"
pull_request:
- main

defaults:
run:
Expand All @@ -18,8 +18,17 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-13"]
version: ["0.16.0", "0.16.1", "0.17.0", "0.18.0", "0.19.0"]
os: ["ubuntu-latest", "macos-13", "macos-latest"]
version: ["0.16.1", "0.17.0", "0.18.0", "0.19.0", "0.20.0-alpha.1"]
exclude:
- os: "macos-latest"
version: "0.16.1"
- os: "macos-latest"
version: "0.17.0"
- os: "macos-latest"
version: "0.18.0"
- os: "macos-latest"
version: "0.19.0"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on: # yamllint disable-line rule:truthy
paths:
- .github/labels.yml
- .github/workflows/sync-labels.yml
workflow_dispatch:
workflow_dispatch: {}

jobs:
sync-labels:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minimum_pre_commit_version: 2.18.0
repos:
# Security
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
- repo: https://github.com/gitleaks/gitleaks
Expand All @@ -27,7 +27,7 @@ repos:
stages: ["push"]
# GitHub Actions
- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
rev: v1.7.0
hooks:
- id: actionlint
args: ["-pyflakes="]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ None
## Inputs

<!-- prettier-ignore-start -->
| Name | Required | Description | Default | Possible values |
|---------|----------|-----------------------------------------------------------------------------------|----------|--------------------------|
| version | No | Mint version that can be found [here](https://github.com/mint-lang/mint/releases) | `0.19.0` | `0.18.0`, `0.17.0`, etc. |
| Name | Required | Description | Default | Possible values |
|---------|----------|-----------------------------------------------------------------------------------|------------------|--------------------------|
| version | No | Mint version that can be found [here](https://github.com/mint-lang/mint/releases) | `0.20.0-alpha.1` | `0.19.0`, `0.18.0`, etc. |
<!-- prettier-ignore-end -->

## Example usage
Expand Down
18 changes: 6 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ inputs:
version:
description: "Mint version"
required: false
default: "0.19.0"
default: "0.20.0-alpha.1"
runs:
using: "composite"
steps:
- name: Fail
if: ${{ runner.os == 'Windows' || runner.arch == 'ARM' || runner.arch == 'ARM64' }}
if: (runner.os == 'Windows'
|| (runner.os == 'Linux' && runner.arch == 'ARM')
|| (runner.os == 'Linux' && runner.arch == 'ARM64'))
run: |
echo "::error title=OS is not supported::${RUNNER_OS} ${RUNNER_ARCH} is not supported"
exit 1
Expand All @@ -23,17 +25,9 @@ runs:
id: info
env:
INPUT_VERSION: "${{ inputs.version }}"
run: |
echo "MINT_INSTALLED=$(if command -v mint >/dev/null 2>&1; then echo true; else echo false; fi)" >> "$GITHUB_OUTPUT"
mkdir -p "$GITHUB_WORKSPACE/mint"
echo "MINT_PATH=$GITHUB_WORKSPACE/mint" >> "$GITHUB_OUTPUT"
if [ "${RUNNER_OS}" = "Linux" ]; then
MINT_BINARY=mint-${INPUT_VERSION}-linux
else
MINT_BINARY=mint-${INPUT_VERSION}-osx
fi
echo "MINT_BINARY=$MINT_BINARY" >> "$GITHUB_OUTPUT"
run: ./collect-info.sh
shell: sh
working-directory: "${{ github.action_path }}/src"
- name: Download
if: ${{ steps.info.outputs.MINT_INSTALLED == 'false' }}
uses: robinraju/[email protected]
Expand Down
39 changes: 39 additions & 0 deletions src/collect-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env sh

# Starting from v0.20.0-alpha.1 mint supports macos arm64 OS. This function
# checks if requested version is less than 0.20.x
if_old_version() {
version="$1"
major=$(echo "$version" | cut -d '.' -f 1)
minor=$(echo "$version" | cut -d '.' -f 2)
if [ "$major" -lt 1 ] && [ "$minor" -lt 20 ]; then
echo "true"
else
echo "false"
fi
}

echo "MINT_INSTALLED=$(if command -v mint >/dev/null 2>&1; then echo true; else echo false; fi)" >> "$GITHUB_OUTPUT"
mkdir -p "$GITHUB_WORKSPACE/mint"
echo "MINT_PATH=$GITHUB_WORKSPACE/mint" >> "$GITHUB_OUTPUT"
if [ "${RUNNER_OS}" = "Linux" ]; then
MINT_BINARY=mint-${INPUT_VERSION}-linux
else
if [ "${RUNNER_ARCH#ARM}" != "$RUNNER_ARCH" ]; then
if [ "$(if_old_version "${INPUT_VERSION}")" = "true" ]; then
msg="${RUNNER_OS} ${RUNNER_ARCH} is not supported by mint ${INPUT_VERSION}."
msg="${msg} Try newer version of mint (> 0.19.x)."
echo "::error title=OS is not supported::${msg}"
exit 1
else
MINT_BINARY=mint-${INPUT_VERSION}-macos-latest
fi
else
if [ "$(if_old_version "${INPUT_VERSION}")" = "true" ]; then
MINT_BINARY=mint-${INPUT_VERSION}-osx
else
MINT_BINARY=mint-${INPUT_VERSION}-macos-13
fi
fi
fi
echo "MINT_BINARY=$MINT_BINARY" >> "$GITHUB_OUTPUT"

0 comments on commit bce27e7

Please sign in to comment.