Skip to content

Commit

Permalink
Attempting fail check for github action, added return code for tests …
Browse files Browse the repository at this point in the history
…and installed required shells
  • Loading branch information
Kraft-Cheese committed Jun 26, 2024
1 parent f744f6f commit ba0529c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
64 changes: 33 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ on:
- '**' # 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
Expand All @@ -16,67 +30,55 @@ jobs:

- name: Run x86 tests
run: |
set -e
chmod +x run-tests.sh
./run-tests.sh -Di386 test
./run-tests.sh -Di386 clean
./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]
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 }}
shell: ${{ matrix.shells }}

- name: Run shell tests
shell: ${{ matrix.shells }}
run: |
echo "Running tests with $0"
set -e
chmod +x run-tests.sh
./run-tests.sh -Dsh test
./run-tests.sh -Dsh clean
./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
- name: Run bootstrap shell with all shells
run: |
./bootstrap-pnut.sh
set -e
chmod +x bootstrap-pnut.sh
./bootstrap-pnut.sh TEST_ALL_SHELLS || exit 1
- name: Run bootstrap x86
run: |
./bootstrap-pnut-x86.sh
# benchmarks:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# shells: [bash, ksh, dash, zsh, ash, yash]
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# with: # Checkout code from the branch that triggered the workflow
# ref: ${{ github.ref }}
# shell: ${{ matrix.shells }}
# - name: Run benchmarks
# run: |
# chmod +x benchmark.sh
# ./benchmark.sh ${{ matrix.shells }}
# - name: Upload benchmark results
# uses: actions/upload-artifact@v2
# with:
# name: benchmark-results-${{ matrix.shells }} # Name of the artifact
# path: benchmark_results_${{ matrix.shells }}.tex # Upload the benchmark results
set -e
chmod +x bootstrap-pnut-x86.sh
./bootstrap-pnut-x86.sh || exit 1
end-message: # This job will run after the test job is completed
success-message:
runs-on: ubuntu-latest
needs: [x86-test, shell-test, bootstraps]
steps:
Expand Down
5 changes: 4 additions & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,13 @@ test() {

if [ $failed -ne 0 ]; then
echo "Failed tests:"
for test in "${failed_tests[@]}"; do
for test in "${failed_tests[@]}"; do
echo "- $test"
done
return 1
fi

return 0
}

# Determine action to perform
Expand Down

0 comments on commit ba0529c

Please sign in to comment.