Added Github action to run tests on active PR #35
Workflow file for this run
This file contains 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: run-tests | |
on: | |
pull_request: # Should trigger on pull requests for all branches | |
branches: | |
- '**' # Matches all branches | |
jobs: | |
x86-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run x86 tests | |
run: | | |
set -e | |
chmod +x run-tests.sh | |
./run-tests.sh -Di386 test || exit 1 | |
./run-tests.sh -Di386 clean || true | |
shell-test-1: # First shell test job | |
# strategy: | |
# matrix: | |
# shells: [bash, zsh, yash, ash] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install shell | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y bash zsh yash ash | |
- name: Run shell tests | |
run: | | |
set +e | |
chmod +x run-tests.sh | |
shells=("bash" "zsh" "yash" "ash") | |
failures=0 | |
for shell in "${shells[@]}"; do | |
$shell ./run-tests.sh -Dsh test | |
status=$? | |
if [ $status -ne 0 ]; then | |
echo "Test failed with $shell" | |
failures=$((failures+1)) | |
fi | |
$shell ./run-tests.sh -Dsh clean || true | |
done | |
if [ $failures -ne 0 ]; then | |
echo "$failures shell tests failed" | |
exit 1 | |
fi | |
shell-test-2: # Second shell test job | |
# strategy: | |
# matrix: | |
# shells: [ksh, dash, mksh] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install shell | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ksh dash mksh | |
- name: Run shell tests | |
run: | | |
set +e | |
chmod +x run-tests.sh | |
shells=("ksh" "dash" "mksh") | |
failures=0 | |
for shell in "${shells[@]}"; do | |
$shell ./run-tests.sh -Dsh test | |
status=$? | |
if [ $status -ne 0 ]; then | |
echo "Test failed with $shell" | |
failures=$((failures+1)) | |
fi | |
$shell ./run-tests.sh -Dsh clean || true | |
done | |
if [ $failures -ne 0 ]; then | |
echo "$failures shell tests failed" | |
exit 1 | |
fi | |
bootstraps: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install shells | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y bash ksh dash zsh yash ash mksh | |
- name: Run bootstrap shell with all shells | |
run: | | |
set -e | |
chmod +x bootstrap-pnut.sh | |
./bootstrap-pnut.sh TEST_ALL_SHELLS || exit 1 | |
- name: Run bootstrap x86 | |
run: | | |
set -e | |
chmod +x bootstrap-pnut-x86.sh | |
./bootstrap-pnut-x86.sh || exit 1 | |
success-message: | |
runs-on: ubuntu-latest | |
needs: [x86-test, shell-test-1, shell-test-2, bootstraps] | |
steps: | |
- name: Tests finished | |
run: | | |
echo " ,-~~-.___." | |
echo " / | ' \\ Pnut tests completed...." | |
echo "( ) 0" | |
echo " \\_/-, ,----'" | |
echo " ==== //" | |
echo " / \\-'~; /~~~(O)" | |
echo " / __/~| / |" | |
echo "=( _____| (_________| " |