Skip to content

Commit 84c7539

Browse files
committed
Update CI scripts. Add binary release
1 parent b5e54d9 commit 84c7539

File tree

1 file changed

+58
-49
lines changed

1 file changed

+58
-49
lines changed

.github/workflows/publish.yml

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-latest, macos-latest] # windows-latest,
14-
project: [benchmarking-tool]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
1514
include:
1615
- os: ubuntu-latest
1716
dynamic-library: libqbdi_tracer.so
1817
- os: macos-latest
1918
dynamic-library: libqbdi_tracer.dylib
19+
- os: windows-latest
20+
dynamic-library: libqbdi_tracer.dll
21+
executable-extension: '.exe'
2022

2123
steps:
2224
- uses: actions/checkout@v4
@@ -26,66 +28,91 @@ jobs:
2628

2729
- name: Check
2830
run: cargo check
29-
working-directory: ${{ matrix.project }}
31+
working-directory: benchmarking-tool
3032

3133
- name: Get QBDI (linux)
3234
if: ${{ matrix.os == 'ubuntu-latest' }}
33-
run: sudo dpkg -i QBDI-*-*-X86_64.deb
35+
run:
36+
curl https://github.com/QBDI/QBDI/releases/download/v0.12.0/QBDI-0.12.0-ubuntu24.04-X86_64.deb > QBDI.deb
37+
sudo dpkg -i QBDI.deb
3438

3539
- name: Get QBDI (macos)
3640
if: ${{ matrix.os == 'macos-latest' }}
3741
run: |
3842
curl https://github.com/QBDI/QBDI/releases/download/v0.12.0/QBDI-0.12.0-osx-AARCH64.pkg -L > QBDI.pkg
39-
file QBDI.pkg
4043
sudo installer -pkg QBDI.pkg -target ~
41-
44+
45+
- name: Get QBDI (windows)
46+
if: ${{ matrix.os == 'windows-latest' }}
47+
run: |
48+
curl https://github.com/QBDI/QBDI/releases/download/v0.12.0/QBDI-0.12.0-windows-X86_64.exe -L > QBDI.exe
49+
./QBDI.exe
50+
4251
- name: Build binary, example and QBDI
43-
working-directory: ${{ matrix.project }}
52+
working-directory: benchmarking-tool
53+
shell: bash
4454
run: |
4555
cargo build
4656
mv target/debug/benchmark .
47-
48-
cargo build --example iterations
49-
mv target/debug/examples/iterations .
5057
5158
bash build-qbdi.sh
5259
mv 'qbdi/build/${{ matrix.dynamic-library }}' .
5360
54-
- name: Run iterations
55-
working-directory: ${{ matrix.project }}
61+
- name: Build and run iterations
62+
working-directory: benchmarking-tool
63+
shell: bash
5664
run: |
65+
cargo build --example iterations
66+
mv target/debug/examples/iterations${{ matrix.executable-extension }} .
67+
5768
for i in {0..3}
5869
do
5970
i=$((10**i))
6071
61-
echo "::group::benchmark ./iterations $i"
62-
./benchmark qbdi ./iterations $i
72+
echo "::group::benchmark${{ matrix.executable-extension }} qbdi ./iterations${{ matrix.executable-extension }} $i"
73+
./benchmark${{ matrix.executable-extension }} qbdi ./iterations${{ matrix.executable-extension }} $i
6374
echo "::endgroup::"
6475
done
6576
66-
# - name: Lint
67-
# run: cargo clippy
68-
# working-directory: ${{ matrix.project }}
77+
- name: Setup SDE binaries
78+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' }}
79+
uses: petarpetrovt/setup-sde@v3.0
80+
with:
81+
environmentVariableName: SDE_PATH # default value is `SDE_PATH`
82+
sdeVersion: 9.58.0 # possible values: 9.58.0 (default), 9.33.0
6983

70-
publish-assets:
71-
if: false
84+
- name: Run SDE (linux or windows)
85+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' }}
86+
run:
87+
for i in {0..3}
88+
do
89+
i=$((10**i))
7290

91+
echo "::group::benchmark${{ matrix.executable-extension }} sde ./iterations${{ matrix.executable-extension }} $i"
92+
./benchmark${{ matrix.executable-extension }} sde ./iterations${{ matrix.executable-extension }} $i
93+
echo "::endgroup::"
94+
done
95+
96+
publish-assets:
7397
needs: check
7498

7599
permissions: write-all
76100

77101
strategy:
102+
fail-fast: false
78103
matrix:
79104
os: [ubuntu-latest, windows-latest, macos-latest]
80-
binary: [benchmarking-tool]
81105
include:
82106
- os: windows-latest
83107
platform-name: x86_64-pc-windows
84108
executable-extension: ".exe"
109+
dynamic-library: libqbdi_tracer.dll
85110
- os: ubuntu-latest
86111
platform-name: x86_64-unknown-linux
112+
dynamic-library: libqbdi_tracer.so
87113
- os: macos-latest
88114
platform-name: aarch64-apple-darwin
115+
dynamic-library: libqbdi_tracer.dylib
89116

90117
runs-on: ${{ matrix.os }}
91118

@@ -98,39 +125,21 @@ jobs:
98125
- uses: actions/checkout@v4
99126
- uses: dtolnay/rust-toolchain@stable
100127

101-
- name: Set variables
102-
id: information
103-
shell: bash
104-
run: |
105-
echo "GITHUB_RUN_DATE=$(TZ="Europe/London" date +"%Y-%m-%d %T")" >> "$GITHUB_OUTPUT"
106-
echo "GIT_LAST_COMMIT=$(git log -n 1 --format="%H")" >> "$GITHUB_OUTPUT"
107-
IFS='~' read -r project example <<< '${{ matrix.binary }}'
108-
echo "WORKING_DIRECTORY=$project" >> "$GITHUB_OUTPUT"
109-
echo "PROJECT_NAME=$project" >> "$GITHUB_OUTPUT"
110-
if [ -n "$example" ]; then
111-
echo "BUILD_SPECIFIER=--example $example" >> "$GITHUB_OUTPUT"
112-
echo "ASSET_PATH=${{ env.OUT }}/examples/$example${{ matrix.executable-extension }}" >> "$GITHUB_OUTPUT"
113-
echo "ASSET_NAME=$example" >> "$GITHUB_OUTPUT"
114-
else
115-
echo "BUILD_SPECIFIER=" >> "$GITHUB_OUTPUT"
116-
echo "ASSET_PATH=${{ env.OUT }}/$project${{ matrix.executable-extension }}" >> "$GITHUB_OUTPUT"
117-
echo "ASSET_NAME=$project" >> "$GITHUB_OUTPUT"
118-
fi
119-
120128
- name: Build binary
121-
working-directory: ${{ steps.information.outputs.WORKING_DIRECTORY }}
122-
run: cargo build ${{ steps.information.outputs.BUILD_SPECIFIER }} --profile ${{ env.PROFILE }}
123-
env:
124-
GITHUB_RUN_DATE: ${{ steps.information.outputs.GITHUB_RUN_DATE }}
125-
GIT_LAST_COMMIT: ${{ steps.information.outputs.GIT_LAST_COMMIT }}
129+
working-directory: benchmarking-tool
130+
run: cargo build --profile ${{ env.PROFILE }}
126131

127132
- name: Publish binary
128-
working-directory: ${{ steps.information.outputs.WORKING_DIRECTORY }}
133+
working-directory: benchmarking-tool
129134
shell: bash
130135
env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
131136
run: |
132-
FROM='${{ steps.information.outputs.ASSET_PATH }}'
133-
TO='${{ steps.information.outputs.ASSET_NAME }}-${{ matrix.platform-name }}${{ matrix.executable-extension }}'
134-
LABEL="${{ steps.information.outputs.PROJECT_NAME }}-$TO"
137+
bash build-qbdi.sh
138+
mv 'qbdi/build/${{ matrix.dynamic-library }}' .
139+
140+
FROM='${{ env.OUT }}/benchmarking-tool${{ matrix.executable-extension }}'
141+
TO='benchmark-${{ matrix.platform-name }}${{ matrix.executable-extension }}'
135142
mv $FROM $TO
136-
gh release upload $GH_RELEASE "$TO#$LABEL" --clobber
143+
gh release upload $GH_RELEASE "$TO" --clobber
144+
gh release upload $GH_RELEASE "${{ matrix.dynamic-library }}" --clobber
145+

0 commit comments

Comments
 (0)