Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Adding simple cicd.
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurw committed Jan 7, 2024
1 parent a014ed6 commit 14e1462
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pushd src;
make;
popd;
30 changes: 30 additions & 0 deletions .github/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

# Define the list of demos
demos="e1m7-607 impfight m1-fast m1-normal m1-simple"
error=0

# Create the toGround folder if it doesn't exist
mkdir -p toGround/

# Loop through each demo
for demo in $demos
do
# Run Chocolate Doom for each demo
echo -e "\n\n$(date +"%Y-%m-%d %H:%M:%S") Will OPS-SAT-1 run DOOM?\n" >> toGround/doom.log
timestamp=$(date +"%Y%m%d%H%M%S")
./src/bin/opssat-doom -nosound -nomusic -nosfx -nodraw -iwad demos/doom.wad -statdump toGround/${demo}-output-${timestamp}.txt -cdemo demos/${demo} >> toGround/doom.log

# Check the output
if diff toGround/${demo}-output-${timestamp}.txt demos/${demo}.txt; then
echo "$(date +"%Y-%m-%d %H:%M:%S") OK - demos/${demo}" >> toGround/summary.log
else
echo "$(date +"%Y-%m-%d %H:%M:%S") ERROR - demos/${demo}" >> toGround/summary.log
error=1
fi
done

echo toGround/summary.log;

# Qapla'
exit $error
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build

on: [push, workflow_dispatch]

jobs:
build:
name: "Ubuntu 22.04"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

- name: Build
shell: bash
run: ./.github/build.sh
- name: Test
shell: bash
run: ./.github/test.sh
2 changes: 1 addition & 1 deletion src/doomgeneric_opssat.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void DG_Init()

void DG_DrawFrame()
{
if (frames % 500 == 0)
if (frames % 50 == 0)
{
char* filename = (char*)malloc(24 * sizeof(char));
sprintf(filename, "output/output%06d.jpg", frames);
Expand Down
2 changes: 1 addition & 1 deletion src/r_segs.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ R_StoreWallRange

// calculate rw_distance for scale calculation
rw_normalangle = curline->angle + ANG90;
offsetangle = rw_normalangle-rw_angle1;
offsetangle = abs(rw_normalangle-rw_angle1);

if (offsetangle > ANG90)
offsetangle = ANG90;
Expand Down

0 comments on commit 14e1462

Please sign in to comment.