Skip to content

Commit 1ba1069

Browse files
committed
Set up GitHub Actions for build testing..
1 parent f79bb3d commit 1ba1069

File tree

11 files changed

+475
-0
lines changed

11 files changed

+475
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Bundle Ignored Files'
2+
description: 'Bundle all untracked ignored files as an artifact'
3+
4+
inputs:
5+
name:
6+
description: 'Artifact name'
7+
required: true
8+
default: 'artifact_diag'
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- shell: bash
14+
run: |
15+
artifacts=$( git status --porcelain --ignored -uall | egrep '^[!]' | cut -c 4- || true )
16+
tar -cvf "${{inputs.name}}" $artifacts || true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Sanity-Check Working Tree'
2+
description: 'Verify that working tree (and index) of repository is "clean"'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- shell: bash
7+
run: |
8+
changed=$( git status --porcelain )
9+
if test -z "$changed" ; then
10+
echo "No unexpected changes to the working tree found."
11+
exit 0
12+
fi
13+
untracked=$( echo "$changed" | egrep '^[?]' || true )
14+
changed=$( echo "$changed" | egrep '^[^?]' || true )
15+
if test -n "$untracked" ; then
16+
echo "Build process adds files not covered by .gitignore:"
17+
echo "$untracked"
18+
else
19+
echo "No unexpected untracked files found."
20+
fi
21+
if test -n "$changed" ; then
22+
echo "Build process tampers with tracked files:"
23+
echo "$changed"
24+
else
25+
echo "No changes to tracked files found."
26+
fi
27+
exit 1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Configure POV-Ray for Unix'
2+
description: 'Run `configure` build step for POV-Ray for Unix'
3+
4+
inputs:
5+
configure-options:
6+
description: 'Additional option for `configure` script'
7+
required: false
8+
default: ''
9+
c-compiler:
10+
description: 'C Compiler to invoke'
11+
required: false
12+
default: ''
13+
cxx-compiler:
14+
description: 'C++ Compiler to invoke'
15+
required: false
16+
default: ''
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- shell: bash
22+
run: |
23+
# TODO: Figure out a neat way to compile with SDL to check the build,
24+
# but have `make check` pass -D instead of +D to POV-Ray
25+
# TODO: Invoke the chosen compiler, rather than the standard one
26+
if test -n "${{inputs.c-compiler}}" ; then
27+
export CC="${{inputs.c-compiler}}"
28+
fi
29+
if test -n "${{inputs.cxx-compiler}}" ; then
30+
export CXX="${{inputs.cxx-compiler}}"
31+
fi
32+
./configure --without-libsdl --without-x ${{inputs.configure-options}} COMPILED_BY="GitHub"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Install Packages (apt)'
2+
description: 'Install required packages using apt'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- shell: bash
7+
run: |
8+
# Make sure our package list is up to date
9+
sudo apt-get update
10+
# Make sure we have all the libraries we want,
11+
# but don't bother upgrading pre-installed ones.
12+
sudo apt-get install --no-upgrade \
13+
libboost-dev \
14+
libboost-date-time-dev \
15+
libz-dev \
16+
libpng-dev \
17+
libjpeg-dev \
18+
libtiff-dev \
19+
libopenexr-dev \
20+
libsdl-dev
21+
# Make sure we have all the tools we want
22+
# (nothing here at the moment)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Install Packages (brew)'
2+
description: 'Install required packages using brew'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- shell: bash
7+
run: |
8+
# Make sure our package list is up to date
9+
brew update
10+
# Make sure we have all the libraries we want
11+
brew install boost
12+
brew install zlib
13+
brew install libpng
14+
brew install libjpeg
15+
brew install libtiff
16+
brew install openexr
17+
brew install sdl
18+
# Make sure we have all the tools we want
19+
brew install automake
20+
brew install pkg-config
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: 'Make POV-Ray for Unix'
2+
description: 'Run `make` build step for POV-Ray for Unix'
3+
4+
inputs:
5+
make-target:
6+
description: 'Target for `make` command'
7+
required: false
8+
default: ''
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- shell: bash
14+
run: |
15+
make ${{ inputs.make-target }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: 'Pre-Build POV-Ray for Unix'
2+
description: 'Run `prebuild.sh` build step for POV-Ray for Unix'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- shell: bash
7+
run: |
8+
cd unix && ./prebuild.sh && cd ..
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Build POV-Ray for Windows'
2+
description: 'Build POV-Ray for Windows'
3+
4+
inputs:
5+
pov-ray-is-autobuild:
6+
description: 'POV_RAY_IS_AUTOBUILD value'
7+
required: true
8+
default: '1'
9+
pov-ray-build-id:
10+
description: 'POV_RAY_BUILD_ID value'
11+
required: true
12+
built-by:
13+
description: 'BUILT_BY value'
14+
required: true
15+
default: 'GitHub'
16+
solution:
17+
description: 'subdirectory of `windows` in which `povray.sln` is located'
18+
required: true
19+
configuration:
20+
description: 'solution configuration to build'
21+
required: false
22+
default: 'Release'
23+
platform:
24+
description: 'solution platform to build'
25+
required: false
26+
default: 'x64'
27+
toolset:
28+
description: 'Platform toolset version'
29+
required: false
30+
default: 'v140'
31+
msbuild-options:
32+
description: 'additional MSBuild options'
33+
required: false
34+
default: ''
35+
36+
runs:
37+
using: "composite"
38+
steps:
39+
40+
- name: 'Prebuild'
41+
shell: pwsh
42+
run: |
43+
$env:PovBuildDefs = 'POV_RAY_IS_AUTOBUILD=${{ inputs.pov-ray-is-autobuild }};'
44+
$env:PovBuildDefs += 'POV_RAY_BUILD_ID="${{ inputs.pov-ray-build-id }}";'
45+
$env:PovBuildDefs += 'BUILT_BY="${{ inputs.built-by }}";'
46+
msbuild `
47+
/t:Rebuild /m `
48+
/p:Configuration=${{ inputs.configuration }} `
49+
/p:Platform=${{ inputs.platform }} `
50+
/p:PlatformToolset=${{ inputs.toolset }} `
51+
${{ inputs.msbuild-options }} `
52+
windows/${{ inputs.solution }}/povray.sln
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: 'Quick Tests'
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'master'
8+
- 'experimental/*'
9+
- 'feature/*'
10+
- 'release/*'
11+
pull_request:
12+
branches:
13+
- 'master'
14+
- 'experimental/*'
15+
- 'feature/*'
16+
- 'release/*'
17+
18+
jobs:
19+
build_unix:
20+
name: 'Unix Build Test'
21+
runs-on: ubuntu-latest
22+
steps:
23+
24+
- name: 'Check out Repository'
25+
uses: actions/checkout@v2
26+
27+
- name: 'Install Prerequisites'
28+
uses: c-lipka/povray/.github/actions/unix_getlibs_apt@master
29+
30+
- name: 'Prebuild'
31+
uses: c-lipka/povray/.github/actions/unix_prebuild@master
32+
- name: 'Sanity-Check Working Tree'
33+
uses: c-lipka/povray/.github/actions/unix_check_repo@master
34+
35+
- name: 'Configure'
36+
uses: c-lipka/povray/.github/actions/unix_configure@master
37+
- name: 'Sanity-Check Working Tree'
38+
uses: c-lipka/povray/.github/actions/unix_check_repo@master
39+
40+
- name: 'Bundle Artifacts for Diagnostics'
41+
if: ${{ always() }}
42+
uses: c-lipka/povray/.github/actions/unix_bundle_ignored@master
43+
with:
44+
name: artifact_diag_unix.tar
45+
46+
- name: 'Build'
47+
uses: c-lipka/povray/.github/actions/unix_make@master
48+
- name: 'Sanity-Check Working Tree'
49+
uses: c-lipka/povray/.github/actions/unix_check_repo@master
50+
51+
- name: 'Check Functionality'
52+
uses: c-lipka/povray/.github/actions/unix_make@master
53+
with:
54+
make-target: check
55+
- name: 'Sanity-Check Working Tree'
56+
uses: c-lipka/povray/.github/actions/unix_check_repo@master
57+
58+
# - name: 'Install'
59+
# uses: c-lipka/povray/.github/actions/unix_make@master
60+
# with:
61+
# make-target: install
62+
# - name: 'Sanity-Check Working Tree'
63+
# uses: c-lipka/povray/.github/actions/unix_check_repo@master
64+
65+
- name: 'Upload Artifacs for Diagnostics'
66+
if: ${{ failure() }}
67+
uses: actions/upload-artifact@v2
68+
with:
69+
name: artifact_diag_unix
70+
path: artifact_diag_unix.tar
71+
72+
# TODO: Maybe do some basic installation checking.
73+
74+
build_windows:
75+
name: 'Windows Build Test'
76+
runs-on: windows-latest
77+
steps:
78+
79+
- name: 'Check out Repository'
80+
uses: actions/checkout@v2
81+
82+
- name: 'Add MSBuild to PATH'
83+
uses: microsoft/[email protected]
84+
85+
- name: 'Build'
86+
uses: c-lipka/povray/.github/actions/windows_build@master
87+
with:
88+
pov-ray-build-id: gh${{github.run_number}}
89+
solution: vs2015
90+
configuration: Release
91+
platform: x64
92+
toolset: v142
93+
msbuild-options: ''
94+
- name: 'Sanity-Check Working Tree'
95+
uses: c-lipka/povray/.github/actions/unix_check_repo@master

0 commit comments

Comments
 (0)