Skip to content

Added Github action to run tests on active PR #24

Added Github action to run tests on active PR

Added Github action to run tests on active PR #24

Workflow file for this run

name: run-tests
on:
pull_request: # Should trigger on pull requests for all branches
branches:
- '**' # Matches all branches
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with: # Checkout code from the branch that triggered the workflow
ref: ${{ github.ref }}
- name: Install required shells
run: |
sudo apt-get update
sudo apt-get install -y ksh zsh dash mksh yash busybox-static
x86-test:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v2
with: # Checkout code from the branch that triggered the workflow
ref: ${{ github.ref }}
- 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:
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
shells: [bash, ksh, dash, zsh, ash, yash, mksh]
steps:
- name: Checkout code
uses: actions/checkout@v2
with: # Checkout code from the branch that triggered the workflow
ref: ${{ github.ref }}
- name: Run shell tests
shell: ${{ matrix.shells }}

Check failure on line 52 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / run-tests

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 52, Col: 16): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.shells
run: |
echo "Running tests with $0"
set -e
chmod +x run-tests.sh
./run-tests.sh -Dsh test || exit 1
./run-tests.sh -Dsh clean || true
bootstraps:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v2
with: # Checkout code from the branch that triggered the workflow
ref: ${{ github.ref }}
- 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, bootstraps]
steps:
- name: Tests finished
run: |
echo " ,-~~-.___."
echo " / | ' \\ Pnut tests completed...."
echo "( ) 0"
echo " \\_/-, ,----'"
echo " ==== //"
echo " / \\-'~; /~~~(O)"
echo " / __/~| / |"
echo "=( _____| (_________| "