Сделал для Linux
This commit is contained in:
parent
991448088e
commit
f65226d9ee
1 changed files with 23 additions and 20 deletions
43
.github/workflows/compile-and-test.yml
vendored
43
.github/workflows/compile-and-test.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Compile and Test
|
name: Compile and Test on Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -10,35 +10,38 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup MinGW and Make
|
- name: Make `makefile.sh` executable
|
||||||
run: |
|
run: |
|
||||||
choco install mingw -y
|
chmod +x makefile.sh
|
||||||
choco install make -y
|
|
||||||
refreshenv
|
|
||||||
|
|
||||||
- name: Compile and Run Tests
|
- name: Compile using makefile.sh
|
||||||
run: |
|
run: |
|
||||||
cd ComputationalGeometry/6Ex
|
./makefile.sh
|
||||||
make
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "::error::Build failed"
|
echo "::error::Compilation failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Найти все файлы в папке `t` и передать их в программу
|
- name: Run Tests
|
||||||
for %f in (t\*) do (
|
run: |
|
||||||
echo "Testing with file: %f"
|
cd ComputationalGeometry/6Ex
|
||||||
echo 0 > input.txt
|
for file in t/*; do
|
||||||
echo %f >> input.txt
|
echo "Testing with file: $file"
|
||||||
a.exe < input.txt
|
|
||||||
if %errorlevel% neq 0 (
|
# Создаём файл ввода
|
||||||
echo "::error::Test failed for %f"
|
echo "0" > input.txt
|
||||||
|
echo "$file" >> input.txt
|
||||||
|
|
||||||
|
# Запускаем программу
|
||||||
|
./a.out < input.txt
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "::error::Test failed for $file"
|
||||||
exit 1
|
exit 1
|
||||||
)
|
fi
|
||||||
)
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue