Merge changes in to support parsing bash scripts #522
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: Tests | |
on: | |
pull_request_target: | |
types: [assigned, opened, synchronize, reopened, ready_for_review] | |
# the paths that trigger the ci | |
paths: | |
- compiler/** | |
- runtime/** | |
- evaluation/** | |
- annotations/** | |
- scripts/** | |
push: | |
branches: | |
- main | |
- future | |
paths: | |
- compiler/** | |
- runtime/** | |
- evaluation/** | |
- annotations/** | |
- scripts/** | |
# Jobs section | |
jobs: | |
Pash-Tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20.04 | |
runs-on: ${{ matrix.os }} | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Running Correctness Tests | |
run: | | |
sudo touch /.githubenv | |
# install the system deps and pash the environment | |
sudo -E bash scripts/distro-deps.sh -o | |
# install pash | |
sudo -E bash scripts/setup-pash.sh -o | |
export PASH_TOP=$PWD | |
export PATH=$PATH:$PASH_TOP | |
# run all the tests (INTRO, INTERFACE, COMPILER) | |
cd scripts && bash run_tests.sh | |
# fetch the execution results of the passed/failed | |
cd workflow && bash parse.sh > results.log 2>&1 | |
# get the timer | |
timer=$(LANG=en_us_88591; date) | |
echo "VERSION<<EOF" >> $GITHUB_ENV | |
echo "OS:${{matrix.os}}" >> $GITHUB_ENV | |
echo "$timer" >> $GITHUB_ENV | |
# Parse the results and construct a github message post | |
# we append the data to the global env | |
cat results.log >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- name: Comment on PR | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
let body = `${{ env.VERSION }}` | |
console.log(context) | |
// if we are directly pushing on main/future, we cannot push comments -> exit | |
if (context.eventName === "push" && (context.ref === "refs/heads/main" || context.ref === "refs/heads/future")) { | |
return 0; | |
} | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: body, | |
}) | |
- name: Exit Code | |
run: | | |
# check if everything executed without errors | |
cd scripts/workflow && bash exit_code.sh | |
shellcheck: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: ludeeus/action-shellcheck@master | |
env: | |
# Only check some field splitting problems now, but we should check | |
# others in the future. | |
SHELLCHECK_OPTS: | |
-i SC2046 | |
-i SC2048 | |
-i SC2053 | |
-i SC2068 | |
-i SC2086 | |
-i SC2206 | |
-i SC2254 | |
with: | |
ignore_paths: | |
annotations | |
compiler/parser/libdash | |
compiler/tests | |
evaluation | |
python_pkgs | |
runtime/agg/cpp/tests | |
scripts | |
ignore_names: | |
test_evaluation_scripts.sh |