Skip to content

Added Github action to run tests on active PR #49

Added Github action to run tests on active PR

Added Github action to run tests on active PR #49

Workflow file for this run

name: run-tests
on:
pull_request: # Should trigger on pull requests for all branches
branches:
- '**' # Matches all branches
jobs:
tests-exe: # Run tests for pnut-exe on all supported platforms and architectures
strategy:
matrix:
include:
- target: i386
host: ubuntu-latest
- target: x86_64
host: ubuntu-latest
- target: mac_os
host: macos-latest
runs-on: ${{ matrix.host }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run ${{ matrix.target }} tests on ${{ matrix.host }}
run: |
set -e
./run-tests.sh ${{ matrix.target }}
tests-shell: # Run tests for pnut-sh on all supported shells
strategy:
matrix:
shell: ["bash", "dash", "ksh", "mksh", "yash", "zsh"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install ${{ matrix.shell }} shell
run: |
sudo apt-get update
sudo apt-get install -y bash ${{ matrix.shell }}
- name: Run tests with ${{ matrix.shell }}
run: |
set -e
bash ./run-tests.sh sh --shell ${{ matrix.shell }}
bootstrap-pnut-sh:
strategy:
matrix:
shell: ["bash", "dash", "ksh", "mksh", "yash", "zsh"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install ${{ matrix.shell }} shell
run: |
sudo apt-get update
sudo apt-get install -y bash ${{ matrix.shell }}
- name: Bootstrap pnut.sh on ${{ matrix.shell }}
run: |
set -e
bash ./bootstrap-pnut.sh --shell ${{ matrix.shell }}
bootstrap-pnut-exe:
strategy:
matrix:
shell: ["dash", "ksh"] # Not testing on other shells to save time
include:
- target: i386
host: ubuntu-latest
- target: x86_64
host: ubuntu-latest
- target: mac_os
host: macos-latest
shell: bash # Only testing on bash for mac_os
runs-on: ${{ matrix.host }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install ${{ matrix.shell }} shell
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.shell }}
- name: Bootstrap pnut-exe with ${{ matrix.target }} backend
run: |
set -e
./bootstrap-pnut-exe.sh --backend ${{ matrix.target }}
- name: Bootstrap pnut-exe with ${{ matrix.target }} backend on ${{ matrix.shell }}
run: |
set -e
./bootstrap-pnut-exe.sh --backend ${{ matrix.target }} --shell ${{ matrix.shell }}
success-message:
runs-on: ubuntu-latest
needs: [tests-exe, tests-shell, bootstrap-pnut-sh, bootstrap-pnut-exe]
steps:
- name: Tests finished
run: |
echo " ,-~~-.___."
echo " / | ' \\ Pnut tests completed...."
echo "( ) 0"
echo " \\_/-, ,----'"
echo " ==== //"
echo " / \\-'~; /~~~(O)"
echo " / __/~| / |"
echo "=( _____| (_________| "