Skip to content

change pipeline start settings #141

change pipeline start settings

change pipeline start settings #141

Workflow file for this run

name: CI pipeline
on:
push:
branches:
- main
paths:
- src/**
- tests/**
- scripts/**
- .github/workflows/**
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Detect tests for C++
id: detect_tests_cpp
run: |
TEST_RESULTS="$(sh scripts/test_detector.sh cpp)"
echo "Test Results:"
echo "$TEST_RESULTS"
echo "::set-output name=test_results::$TEST_RESULTS"
- name: Test C++ code
run: |
TEST_CASES=($(echo "${{steps.detect_tests_cpp.outputs.test_results}}" | tr ',' '\n'))
IFS=$','
for TEST_CASE in ${TEST_CASES[@]}; do
TEST_NAME=$(echo "$TEST_CASE" | cut -d ':' -f 1)
TEST_NUMBER=$(echo "$TEST_CASE" | cut -d ':' -f 2)
echo "Running $TEST_NUMBER+1 tests for $TEST_NAME"
python scripts/builder.py "${TEST_NAME}.cpp"
python scripts/tester.py "${TEST_NAME}.cpp" "$TEST_NUMBER"
done
- name: Detect tests for C
id: detect_tests_c
run: |
TEST_RESULTS="$(sh scripts/test_detector.sh c)"
echo "Test Results:"
echo "$TEST_RESULTS"
echo "::set-output name=test_results::$TEST_RESULTS"
- name: Test C code
run: |
TEST_CASES=($(echo "${{steps.detect_tests_c.outputs.test_results}}" | tr ',' '\n'))
IFS=$','
for TEST_CASE in ${TEST_CASES[@]}; do
TEST_NAME=$(echo "$TEST_CASE" | cut -d ':' -f 1)
TEST_NUMBER=$(echo "$TEST_CASE" | cut -d ':' -f 2)
echo "Running $TEST_NUMBER+1 tests for $TEST_NAME"
python scripts/builder.py "${TEST_NAME}.c"
python scripts/tester.py "${TEST_NAME}.c" "$TEST_NUMBER"
done
- name: Test manually
run: |
gcc @configs/options src/evaluate_game.c src/game.c -o src/evaluate_game.e
python scripts/tester.py evaluate_game.c 4 manual