fixed: Return success on unknown shell modifications to avoid Alpine … #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Multi-Platform Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
platform: | |
description: 'Build Platform' | |
required: true | |
default: 'all' | |
type: choice | |
options: | |
- all | |
- macos | |
- windows | |
- linux # This will trigger the native Ubuntu test | |
- docker # This will trigger the multi-distro Docker tests | |
push: | |
branches: | |
- main | |
jobs: | |
test_linux_native: # Renamed for clarity | |
name: Linux Test (Native Runner - Ubuntu) # Updated name | |
# Run if platform is 'all' or 'linux', OR if triggered by tag push | |
if: github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' | |
runs-on: ubuntu-latest # Explicitly stating it runs on Ubuntu | |
# REMOVED the strategy matrix - it doesn't change the OS | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Linux tests on native runner (Ubuntu) | |
# No need to pass distro argument as it's always Ubuntu here | |
run: | | |
chmod +x ./linux.sh | |
./linux.sh | |
test_windows: | |
name: Windows Test (${{ matrix.os }}) | |
if: github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'windows' | |
strategy: | |
matrix: | |
os: [windows-2022, windows-2019] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Windows tests | |
shell: pwsh | |
run: | | |
.\windows.ps1 | |
test_macos: | |
name: macOS Test # Simplified name as matrix is just for runner version/arch | |
if: github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' | |
strategy: | |
matrix: | |
os: [macos-latest] # Using latest, can specify e.g., macos-13 for Intel, macos-14 for ARM if needed | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check architecture | |
run: echo "Running on $(uname -m)" | |
- name: Run macOS tests | |
run: | | |
chmod +x ./macos.sh | |
./macos.sh | |
test_docker: | |
name: Docker Test Matrix (${{ matrix.distro }}) | |
# Run if platform is 'all' or 'docker', OR if triggered by tag push | |
if: github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'docker' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- distro: opensuse | |
image: opensuse/leap:latest | |
shell: /bin/bash | |
setup_cmd: "" | |
- distro: alpine | |
image: alpine:latest | |
shell: /bin/sh | |
setup_cmd: "apk update && apk add bash && " | |
- distro: debian | |
image: debian:latest | |
shell: /bin/bash | |
setup_cmd: "" | |
- distro: rocky | |
image: rockylinux:9 | |
shell: /bin/bash | |
setup_cmd: "" | |
- distro: arch | |
image: archlinux:latest | |
shell: /bin/bash | |
setup_cmd: "" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests in Docker ${{ matrix.distro }} container | |
run: | | |
docker run --rm -v "$GITHUB_WORKSPACE":/app -w /app ${{ matrix.image }} ${{ matrix.shell }} -c '${{ matrix.setup_cmd }} chmod +x /app/linux.sh && /app/linux.sh' |