Skip to content

Commit 7781010

Browse files
Improve release artifact naming, enable unit tests
1 parent baa777d commit 7781010

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

Diff for: .github/actions/build-docker-image/action.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ runs:
4242
username: ${{ inputs.username }}
4343
password: ${{ inputs.token }}
4444

45-
- name: Print run number
46-
run: |
47-
echo "Run number for docker file = ${{ github.run_number }}"
48-
shell: bash
49-
5045
# https://github.com/docker/build-push-action
5146
- name: Build and push docker container to ghcr.io
5247
id: build-and-push

Diff for: .github/actions/build-native-binary/action.yaml

+19-12
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,36 @@ runs:
3535
pip3 install meson
3636
shell: bash
3737

38-
- name: Print run number
39-
run: |
40-
echo "Run number for native = ${{ inputs.run_number }}"
41-
shell: bash
42-
4338
- name: Build for ${{ inputs.arch }}
4439
run: |
4540
mkdir build_${{ inputs.arch }}
4641
./scripts/build_openssl_${{ inputs.arch }}.sh
4742
./scripts/build_glib_${{ inputs.arch }}.sh
4843
cd build_${{ inputs.arch }}
49-
cmake -DCMAKE_INSTALL_PREFIX=../dist_${{ inputs.arch }} -DCMAKE_TOOLCHAIN_FILE=../cmake/linux/${{ matrix.arch }}/toolchain.cmake -DOPENSSL_ROOT_DIR=../build_${{ matrix.arch }} -DOPENSSL_CRYPTO_LIBRARY=../build_${{ matrix.arch }}/lib/libcrypto.so -DSUA_BUILD_NUMBER=${{ inputs.run_number }} ..
44+
cmake \
45+
-DCMAKE_INSTALL_PREFIX=../dist_${{ inputs.arch }} \
46+
-DCMAKE_TOOLCHAIN_FILE=../cmake/linux/${{ matrix.arch }}/toolchain.cmake \
47+
-DOPENSSL_ROOT_DIR=../build_${{ matrix.arch }} \
48+
-DOPENSSL_CRYPTO_LIBRARY=../build_${{ matrix.arch }}/lib/libcrypto.so \
49+
-DSUA_BUILD_NUMBER=${{ inputs.run_number }} ..
5050
make
5151
make install
5252
shell: bash
5353

54-
#- name: Run unit tests
55-
# if: ${{ inputs.arch=='amd64' }}
56-
# run: |
57-
# cd dist_${{ inputs.arch }}/utest
58-
# ./TestSDVSelfUpdateAgent
54+
- name: Run unit tests
55+
if: ${{ inputs.arch=='amd64' }}
56+
run: |
57+
cd dist_${{ inputs.arch }}/utest
58+
./TestSDVSelfUpdateAgent
59+
shell: bash
5960

6061
- name: Compress artifacts
61-
run: tar -czvf sua_${{ inputs.arch }}.tar.gz --exclude=lib/cmake --exclude=lib/pkgconfig -C dist_${{ matrix.arch }} bin/sdv-self-update-agent lib
62+
run: |
63+
tar -czvf sua-${{ inputs.arch }}-build-${{ inputs.run_number }}.tar.gz \
64+
--transform s/dist_${{ inputs.arch }}/sua-${{ inputs.arch }}-build-${{ inputs.run_number }}/ \
65+
--exclude=dist_${{ inputs.arch }}/lib/cmake \
66+
--exclude=dist_${{ inputs.arch }}/lib/pkgconfig \
67+
dist_${{ inputs.arch }}/bin/sdv-self-update-agent \
68+
dist_${{ inputs.arch }}/lib
6269
shell: bash
6370

Diff for: .github/workflows/main.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ jobs:
7676
- name: Upload ${{ matrix.arch }} artifact to workspace
7777
uses: actions/upload-artifact@v3
7878
with:
79-
name: sua_${{ matrix.arch }}.tar.gz
80-
path: sua_${{ matrix.arch }}.tar.gz
81-
79+
name: sua-${{ matrix.arch }}-build-${{ github.run_number }}.tar.gz
80+
path: sua-${{ matrix.arch }}-build-${{ github.run_number }}.tar.gz
81+
8282
upload-native-binary:
8383
runs-on: ubuntu-latest
8484
needs: build-native-binary
@@ -98,5 +98,5 @@ jobs:
9898
prerelease: true
9999
automatic_release_tag: build_${{ github.run_number }}
100100
title: "Build ${{ github.run_number }}"
101-
files: "**/sua_*.tar.gz"
101+
files: "**/sua-${{ matrix.arch }}-build-${{ github.run_number }}.tar.gz"
102102

0 commit comments

Comments
 (0)