Skip to content

Commit c32dd73

Browse files
authored
Create GitHub actions (#2)
* starting work on github actions build * updating copyright year in license * adding some events to trigger workflow * adding some ls commands for testing the actions * adding some test pwd commands for debugging * cloning this repo to a non-default dir * fixing bad path for xreg build script * adding script to build this repo * adding distribution file creation * fixing a path typo * adding names to dist commands * fixing another path in creating the dist * adding ubuntu 18 and 16 builds * adding centos 7 build * adding some debug ls commands * removing debug ls * starting on windows build * initial mac build impl. * fixing typo * change to cmake prefix path * final draft of mac build * adding ipcai build for windows * passing cmake prefix path as cmake variable for windows build * adding some debug dir commands to the windows build * updating cmake command for mac ipcai 2020 build * add creation of windows dist file * commenting out the mac build * removing the mac ls debug statements * switching windows build back to using cmake_prefix_path env var - now using a ; to separate entries though * adding a cache command after xreg deps * adding a debug dir statement to test the xreg deps cache * changing specification of CMAKE_INSTALL_PREFIX to cmake command line arg * trigger workflow * changing search and generator vars * more specific about tmp caching, also caching xreg git * changing the ninja path again * disabling this repo build, so hopefully the xreg deps cache * trigger workflow * adding install for ipcai build * turning the ipcai build back on * setting variables before call to cmake * changing slashes * changing the way cur drive is set and adding quotes to cmake path vars * turning echo off * trying to cache the ipcai build * turning on the ipcai dist. * adding some quotes, adding echo on * fixing a path * copying license and readme into the root dir of zip * removing debugging entries
1 parent 1847e08 commit c32dd73

10 files changed

+351
-1
lines changed

.github/workflows/build.yaml

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# GitHub action to build software.
2+
# Linux builds include pre-built dependencies via containers.
3+
# The Windows and MacOS builds build dependencies each run.
4+
5+
name: Build
6+
on:
7+
pull_request:
8+
workflow_dispatch:
9+
push:
10+
11+
jobs:
12+
ubuntu_20_04_build:
13+
runs-on: ubuntu-latest
14+
container: ghcr.io/rg2/xreg-deps-ubuntu-20.04:latest
15+
16+
steps:
17+
- name: Checkout xreg repository master branch
18+
uses: actions/checkout@v2
19+
with:
20+
repository: rg2/xreg
21+
path: ./xreg-git
22+
- name: Checkout this repo (Regi2D3D-IPCAI2020)
23+
uses: actions/checkout@v2
24+
with:
25+
path: ./regi2d3d-ipcai2020
26+
- name: Build xreg master branch
27+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_xreg_cmake_build
28+
shell: bash
29+
- name: Build this repo (Regi2D3D-IPCAI2020)
30+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_regi2d3d_ipcai2020_cmake_build
31+
shell: bash
32+
- name: Install packages needed to create distribution file
33+
run: ./xreg-git/dist/ubuntu_dist_pkgs
34+
shell: bash
35+
- name: Create distribution file
36+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_make_dist ubuntu-20.04
37+
shell: bash
38+
- name: Upload distribution as artifact
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: ubuntu-20.04-build
42+
path: regi2d3d-ipcai2020-ubuntu-20.04.tar.gz
43+
44+
ubuntu_18_04_build:
45+
runs-on: ubuntu-latest
46+
container: ghcr.io/rg2/xreg-deps-ubuntu-18.04:latest
47+
48+
steps:
49+
- name: Checkout xreg repository master branch
50+
uses: actions/checkout@v2
51+
with:
52+
repository: rg2/xreg
53+
path: ./xreg-git
54+
- name: Checkout this repo (Regi2D3D-IPCAI2020)
55+
uses: actions/checkout@v2
56+
with:
57+
path: ./regi2d3d-ipcai2020
58+
- name: Build xreg master branch
59+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_xreg_cmake_build
60+
shell: bash
61+
- name: Build this repo (Regi2D3D-IPCAI2020)
62+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_regi2d3d_ipcai2020_cmake_build
63+
shell: bash
64+
- name: Install packages needed to create distribution file
65+
run: ./xreg-git/dist/ubuntu_dist_pkgs
66+
shell: bash
67+
- name: Create distribution file
68+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_make_dist ubuntu-18.04
69+
shell: bash
70+
- name: Upload distribution as artifact
71+
uses: actions/upload-artifact@v2
72+
with:
73+
name: ubuntu-18.04-build
74+
path: regi2d3d-ipcai2020-ubuntu-18.04.tar.gz
75+
76+
ubuntu_16_04_build:
77+
runs-on: ubuntu-latest
78+
container: ghcr.io/rg2/xreg-deps-ubuntu-16.04:latest
79+
80+
steps:
81+
- name: Checkout xreg repository master branch
82+
uses: actions/checkout@v2
83+
with:
84+
repository: rg2/xreg
85+
path: ./xreg-git
86+
- name: Checkout this repo (Regi2D3D-IPCAI2020)
87+
uses: actions/checkout@v2
88+
with:
89+
path: ./regi2d3d-ipcai2020
90+
- name: Build xreg master branch
91+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_xreg_cmake_build
92+
shell: bash
93+
- name: Build this repo (Regi2D3D-IPCAI2020)
94+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_regi2d3d_ipcai2020_cmake_build
95+
shell: bash
96+
- name: Install packages needed to create distribution file
97+
run: ./xreg-git/dist/ubuntu_dist_pkgs
98+
shell: bash
99+
- name: Create distribution file
100+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_make_dist ubuntu-16.04
101+
shell: bash
102+
- name: Upload distribution as artifact
103+
uses: actions/upload-artifact@v2
104+
with:
105+
name: ubuntu-16.04-build
106+
path: regi2d3d-ipcai2020-ubuntu-16.04.tar.gz
107+
108+
centos_7_build:
109+
runs-on: ubuntu-latest
110+
container: ghcr.io/rg2/xreg-deps-centos-7:latest
111+
112+
steps:
113+
- name: Checkout xreg repository master branch
114+
uses: actions/checkout@v2
115+
with:
116+
repository: rg2/xreg
117+
path: ./xreg-git
118+
- name: Checkout this repo (Regi2D3D-IPCAI2020)
119+
uses: actions/checkout@v2
120+
with:
121+
path: ./regi2d3d-ipcai2020
122+
- name: Build xreg master branch
123+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_xreg_cmake_build
124+
shell: bash
125+
- name: Build this repo (Regi2D3D-IPCAI2020)
126+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_regi2d3d_ipcai2020_cmake_build
127+
shell: bash
128+
- name: Install packages needed to create distribution file
129+
run: ./xreg-git/dist/centos_dist_pkgs
130+
shell: bash
131+
- name: Create distribution file
132+
run: ./regi2d3d-ipcai2020/.github/workflows/linux_make_dist centos-7
133+
shell: bash
134+
- name: Upload distribution as artifact
135+
uses: actions/upload-artifact@v2
136+
with:
137+
name: centos-7-build
138+
path: regi2d3d-ipcai2020-centos-7.tar.gz
139+
140+
windows_build:
141+
runs-on: windows-2019
142+
steps:
143+
- name: Checkout this repo (Regi2D3D-IPCAI2020)
144+
uses: actions/checkout@v2
145+
with:
146+
path: regi2d3d-ipcai2020
147+
- name: Setup Visual C++ environment
148+
uses: ilammy/msvc-dev-cmd@v1
149+
- name: Cache xreg deps and xreg build
150+
id: xreg-deps-cache
151+
uses: actions/cache@v3
152+
with:
153+
path: |
154+
xreg-git
155+
D:\usr\local
156+
D:\tmp\ninja-bin
157+
D:\tmp\cmake-3.22.2-windows-x86_64
158+
D:\tmp\xreg_build
159+
key: ${{ runner.os }}-xreg-deps
160+
- name: Checkout xreg repository master branch
161+
if: steps.xreg-deps-cache.outputs.cache-hit != 'true'
162+
uses: actions/checkout@v2
163+
with:
164+
repository: rg2/xreg
165+
path: xreg-git
166+
- name: Build xreg master branch and its dependencies
167+
if: steps.xreg-deps-cache.outputs.cache-hit != 'true'
168+
run: regi2d3d-ipcai2020\.github\workflows\win_xreg_build.cmd
169+
shell: cmd
170+
- name: Build this repo (Regi2D3D-IPCAI2020)
171+
run: regi2d3d-ipcai2020\.github\workflows\win_regi2d3d_ipcai2020_build.cmd
172+
shell: cmd
173+
- name: Create dist .zip file
174+
run: regi2d3d-ipcai2020\.github\workflows\win_regi2d3d_ipcai2020_make_dist.cmd
175+
shell: cmd
176+
- name: Upload distribution .zip file as artifact.
177+
uses: actions/upload-artifact@v2
178+
with:
179+
name: win-64-build
180+
path: regi2d3d-ipcai2020-win64.zip
181+
182+
#macos_build:
183+
# runs-on: macos-10.15
184+
#
185+
# steps:
186+
# - name: Checkout xreg repository master branch
187+
# uses: actions/checkout@v2
188+
# with:
189+
# repository: rg2/xreg
190+
# path: ./xreg-git
191+
# - name: Checkout this repo (Regi2D3D-IPCAI2020)
192+
# uses: actions/checkout@v2
193+
# with:
194+
# path: ./regi2d3d-ipcai2020
195+
# - name: Installing Ninja build tool
196+
# run: brew install ninja
197+
# - name: Building xreg master branch and its dependencies
198+
# run: XREG_INSTALL_DIR="$HOME/xreg_install" cd ./xreg-git && ./example_build_script_2
199+
# shell: bash
200+
# - name: Building this repo
201+
# run: ./regi2d3d-ipcai2020/.github/workflows/mac_regi2d3d_ipcai2020_cmake_build
202+
# shell: bash
203+
# - name: Creating dist directory
204+
# run: mkdir regi2d3d-ipcai2020-macos-10.15
205+
# shell: bash
206+
# - name: Creating distribution executables
207+
# run: python3 ./xreg-git/dist/make_macos_dist.py $HOME/ipcai2020_install regi2d3d-ipcai2020-macos-10.15 ./xreg_deps_install $HOME/xreg_install
208+
# shell: bash
209+
# - name: Packaging up files
210+
# run: ./regi2d3d-ipcai2020/.github/workflows/mac_make_dist
211+
# shell: bash
212+
# - uses: actions/upload-artifact@v2
213+
# with:
214+
# name: macos-10.15-build
215+
# path: regi2d3d-ipcai2020-macos-10.15.tar.gz

.github/workflows/linux_make_dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
XREG_NAME="regi2d3d-ipcai2020-${1}"
3+
4+
mkdir $XREG_NAME
5+
6+
LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:/opt/tbb/lib/intel64/gcc4.7:$LD_LIBRARY_PATH" \
7+
python3 ./xreg-git/dist/make_linux_dist.py /usr/local $XREG_NAME
8+
9+
cp ./regi2d3d-ipcai2020/README.md $XREG_NAME
10+
cp ./regi2d3d-ipcai2020/extract_fcsv_from_nn_csv.py $XREG_NAME
11+
cp ./regi2d3d-ipcai2020/extract_seg_from_nn_h5.py $XREG_NAME
12+
cp ./regi2d3d-ipcai2020/LICENSE $XREG_NAME
13+
14+
tar czf ${XREG_NAME}.tar.gz $XREG_NAME
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
export CMAKE_PREFIX_PATH=`pwd`/xreg-git/build
3+
4+
cd regi2d3d-ipcai2020
5+
mkdir build
6+
cd build
7+
8+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
9+
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \
10+
..
11+
12+
cmake --build .
13+
14+
cmake --build . --target install
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
cd xreg-git
3+
mkdir build
4+
cd build
5+
6+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON \
7+
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \
8+
-DTBB_DIR:PATH="/opt/tbb/cmake" \
9+
-DXREG_USE_LEGACY_FIND_TBB:BOOL=OFF \
10+
-DXREG_INCLUDE_GIT_HASH_IN_VER_STR:BOOL=ON \
11+
-DXREG_BUILD_APPS:BOOL=OFF \
12+
..
13+
14+
cmake --build .
15+
16+
cmake --build . --target install

.github/workflows/mac_make_dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
XREG_NAME="regi2d3d-ipcai2020-macos-10.15"
3+
4+
cp ./regi2d3d-ipcai2020/README.md $XREG_NAME
5+
cp ./regi2d3d-ipcai2020/extract_fcsv_from_nn_csv.py $XREG_NAME
6+
cp ./regi2d3d-ipcai2020/extract_seg_from_nn_h5.py $XREG_NAME
7+
cp ./regi2d3d-ipcai2020/LICENSE $XREG_NAME
8+
9+
tar czf ${XREG_NAME}.tar.gz $XREG_NAME
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
export CMAKE_PREFIX_PATH="`pwd`/xreg_deps_install:`pwd`/xreg-git/build"
3+
4+
cd regi2d3d-ipcai2020
5+
6+
mkdir build
7+
cd build
8+
9+
cmake -G Ninja \
10+
-DCMAKE_BUILD_TYPE:STRING="Release" \
11+
-DBUILD_SHARED_LIBS:BOOL=OFF \
12+
-DCMAKE_INSTALL_PREFIX:PATH="$HOME/ipcai2020_install" \
13+
..
14+
15+
cmake --build .
16+
17+
cmake --build . --target install
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@echo off
2+
3+
setlocal
4+
5+
set "CUR_DRIVE=%~d0" || EXIT /b
6+
7+
set "PATH=%CUR_DRIVE%\tmp\cmake-3.22.2-windows-x86_64\bin;%CUR_DRIVE%\tmp\ninja-bin;%PATH%" || EXIT /b
8+
9+
set "INSTALL_ROOT=%CUR_DRIVE%\usr\local" || EXIT /b
10+
11+
set "XREG_BUILD_PATH=%CUR_DRIVE%\tmp\xreg_build" || EXIT /b
12+
13+
cd regi2d3d-ipcai2020 || EXIT /b
14+
15+
mkdir build || EXIT /b
16+
17+
cd build || EXIT /b
18+
19+
cmake -G Ninja ^
20+
-Dxreg_DIR:PATH="%XREG_BUILD_PATH%" ^
21+
-DCMAKE_PREFIX_PATH:PATH="%INSTALL_ROOT%" ^
22+
-DCMAKE_INSTALL_PREFIX:PATH="%INSTALL_ROOT%" ^
23+
-DCMAKE_CXX_STANDARD:STRING="11" ^
24+
-DCMAKE_BUILD_TYPE:STRING="Release" ^
25+
-DBUILD_SHARED_LIBS:BOOL="OFF" ^
26+
.. || EXIT /b
27+
28+
cmake --build . --config Release || EXIT /b
29+
30+
cmake --install . || EXIT /b
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
echo off
2+
3+
REM Create a .zip of the compiled binaries
4+
5+
REM Use the drive where this script currently resides
6+
SET "CUR_DRIVE=%~d0"
7+
ECHO CUR_DRIVE = %CUR_DRIVE%
8+
9+
REM Everything will be installed here using the standard
10+
REM bin, include, lib layout
11+
SET "INSTALL_ROOT=%CUR_DRIVE%\usr\local"
12+
ECHO INSTALL_ROOT = %INSTALL_ROOT%
13+
14+
SET "XREG_NAME=regi2d3d-ipcai2020-win64"
15+
MKDIR "%XREG_NAME%" || EXIT /b
16+
MKDIR "%XREG_NAME%\bin" || EXIT /b
17+
18+
XCOPY /E "%INSTALL_ROOT%\bin\OpenCL.dll" "%XREG_NAME%\bin\"
19+
XCOPY /E "%INSTALL_ROOT%\bin\tbb.dll" "%XREG_NAME%\bin\"
20+
XCOPY /E "%INSTALL_ROOT%\bin\setup-xreg-vars.bat" "%XREG_NAME%\bin\"
21+
XCOPY /E "%INSTALL_ROOT%\bin\ffmpeg.exe" "%XREG_NAME%\bin\"
22+
XCOPY /E "%INSTALL_ROOT%\bin\xreg-ipcai-*" "%XREG_NAME%\bin\"
23+
24+
XCOPY /E regi2d3d-ipcai2020\README.md "%XREG_NAME%\"
25+
XCOPY /E regi2d3d-ipcai2020\LICENSE "%XREG_NAME%\"
26+
27+
REM GitHub runners have 7zip installed, so we will use that to create the .zip
28+
7z a -tzip "%XREG_NAME%.zip" "%XREG_NAME%"

.github/workflows/win_xreg_build.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
3+
setlocal
4+
5+
cd xreg-git
6+
7+
call example_build_script_win.cmd

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Robert Grupp
3+
Copyright (c) 2020-2022 Robert Grupp
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)