Skip to content

Make compatible with bash v3 (which is the default version on MacOS). #19

Make compatible with bash v3 (which is the default version on MacOS).

Make compatible with bash v3 (which is the default version on MacOS). #19

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
jobs:
plugin_test:
name: asdf plugin test
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: Homebrew/actions/setup-homebrew@master
- uses: asdf-vm/actions/setup@v3
- uses: actions/checkout@v4
- name: install_plugin
run: mkdir -p ~/.asdf/plugins/ && cp -R "$GITHUB_WORKSPACE" ~/.asdf/plugins/php
- name: require_php
run: echo "php 8.3" > ~/.tool-versions
- name: install_php
run: asdf install php 8.3
- name: test_php
run: |
required_version="8.3" && \
actual_version=$(php -v | grep '(cli)' | awk '{ print $2 }' | sed 's/\.[0-9]*$//') && \
if [[ "$(printf '%s\n' "$required_version" "$actual_version" | sort -V | head -n1)" != "$required_version" ]]; then \
echo "PHP version $actual_version does not meet the required version $required_version" >&2 && exit 1; \
else \
echo "PHP version $actual_version meets the requirement"; \
fi