Skip to content

Commit 6e037d9

Browse files
committed
WIP: combine mac and linux steps
1 parent de1fd9b commit 6e037d9

File tree

1 file changed

+14
-68
lines changed

1 file changed

+14
-68
lines changed

.github/workflows/cmake-test-on.yml

Lines changed: 14 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,15 @@ jobs:
7272

7373
- run: ./firestarr . 2024-06-03 58.81228184403946 -122.9117103995713 01:00 --ffmc 89.9 --dmc 59.5 --dc 450.9 --apcp_prev 0 -v --wx ./test/input/10N_50651/firestarr_10N_50651_wx.csv --output_date_offsets [1] --tz -5 --raster-root ./test/input/10N_50651/ --perim ./test/input/10N_50651/10N_50651.tif
7474

75-
- name: Locate binary (macos)
76-
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
77-
id: locate-macos
75+
- name: Locate binary (non-windows)
76+
if: ${{ matrix.variant == 'Release' && inputs.os != 'windows' }}
77+
id: locate
7878
run: |
7979
# Find the built executable
80-
BINARY=$(find build -type f -name "firestarr" -perm +111 | head -1)
80+
BINARY=$(find build -type f -name "firestarr" ${{ case ( inputs.os == 'macos', '-perm +111', '-executable' ) }} | head -1)
8181
if [ -z "$BINARY" ]; then
8282
echo "ERROR: Could not find firestarr binary"
83-
find build -type f -perm +111
84-
exit 1
85-
fi
86-
echo "binary=$BINARY" >> $GITHUB_OUTPUT
87-
echo "Found binary at: $BINARY"
88-
89-
- name: Locate binary (linux)
90-
if: ${{ matrix.variant == 'Release' && inputs.os == 'ubuntu' }}
91-
id: locate-linux
92-
run: |
93-
# Find the built executable
94-
BINARY=$(find build -type f -name "firestarr" -executable | head -1)
95-
if [ -z "$BINARY" ]; then
96-
echo "ERROR: Could not find firestarr binary"
97-
find build -type f -executable
83+
find build -type f ${{ case ( inputs.os == 'macos', '-perm +111', '-executable' ) }}
9884
exit 1
9985
fi
10086
echo "binary=$BINARY" >> $GITHUB_OUTPUT
@@ -114,23 +100,14 @@ jobs:
114100
echo "Found binary at: $BINARY"
115101
shell: pwsh
116102

117-
- name: Check binary dependencies (macos)
118-
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
119-
run: |
120-
echo "=== Binary info ==="
121-
file ${{ steps.locate-macos.outputs.binary }}
122-
echo ""
123-
echo "=== Dynamic dependencies ==="
124-
otool -L ${{ steps.locate-macos.outputs.binary }} || true
125-
126-
- name: Check binary dependencies (linux)
127-
if: ${{ matrix.variant == 'Release' && inputs.os == 'ubuntu' }}
103+
- name: Check binary dependencies (non-windows)
104+
if: ${{ matrix.variant == 'Release' && inputs.os != 'windows' }}
128105
run: |
129106
echo "=== Binary info ==="
130-
file ${{ steps.locate-linux.outputs.binary }}
107+
file ${{ steps.locate.outputs.binary }}
131108
echo ""
132109
echo "=== Dynamic dependencies ==="
133-
ldd ${{ steps.locate-linux.outputs.binary }} || true
110+
${{ case ( inputs.os == 'macos', 'otool -L', 'ldd' ) }} ${{ steps.locate.outputs.binary }} || true
134111
135112
- name: Check binary dependencies (windows)
136113
if: ${{ matrix.variant == 'Release' && inputs.os == 'windows' }}
@@ -142,35 +119,12 @@ jobs:
142119
(Get-Item "${{ steps.locate-windows.outputs.binary }}").Length / 1MB | ForEach-Object { "{0:N2} MB" -f $_ }
143120
shell: pwsh
144121

145-
- name: Package artifact (macos)
146-
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
147-
run: |
148-
mkdir -p dist
149-
cp README.md LICENSE ORIGIN.md dist/
150-
cp ${{ steps.locate-macos.outputs.binary }} dist/firestarr
151-
152-
# Bundle data files if they exist
153-
[ -f fuel.lut ] && cp fuel.lut dist/
154-
[ -f settings.ini ] && cp settings.ini dist/
155-
[ -f data/fuel.lut ] && cp data/fuel.lut dist/
156-
[ -f data/settings.ini ] && cp data/settings.ini dist/
157-
158-
# Create version info
159-
./firestarr -h | head -n1 > dist/VERSION
160-
161-
# List contents
162-
echo "=== Package contents ==="
163-
ls -la dist/
164-
165-
# Create tarball
166-
tar -czvf ${{ env.OUTPUT_BINARY }}.tar.gz -C dist .
167-
168-
- name: Package artifact (linux)
169-
if: ${{ matrix.variant == 'Release' && inputs.os == 'ubuntu' }}
122+
- name: Package artifact (non-windows)
123+
if: ${{ matrix.variant == 'Release' && inputs.os != 'windows' }}
170124
run: |
171125
mkdir -p dist
172126
cp README.md LICENSE ORIGIN.md dist/
173-
cp ${{ steps.locate-linux.outputs.binary }} dist/firestarr
127+
cp ${{ steps.locate.outputs.binary }} dist/firestarr
174128
175129
# Bundle data files if they exist
176130
[ -f fuel.lut ] && cp fuel.lut dist/
@@ -217,16 +171,8 @@ jobs:
217171
Compress-Archive -Path dist\* -DestinationPath ${{ env.OUTPUT_BINARY }}.zip
218172
shell: pwsh
219173

220-
- name: Upload artifact (macos)
221-
if: ${{ matrix.variant == 'Release' && inputs.os == 'macos' }}
222-
uses: actions/upload-artifact@v4
223-
with:
224-
name: ${{ env.OUTPUT_BINARY }}
225-
path: ${{ env.OUTPUT_BINARY }}.tar.gz
226-
retention-days: 30
227-
228-
- name: Upload artifact (linux)
229-
if: ${{ matrix.variant == 'Release' && inputs.os == 'ubuntu' }}
174+
- name: Upload artifact (non-windows)
175+
if: ${{ matrix.variant == 'Release' && inputs.os != 'windows' }}
230176
uses: actions/upload-artifact@v4
231177
with:
232178
name: ${{ env.OUTPUT_BINARY }}

0 commit comments

Comments
 (0)