@@ -20,31 +20,43 @@ jobs:
20
20
with :
21
21
ref : ${{ github.event.inputs.commit_id }}
22
22
- name : Configure git identity
23
+ env :
24
+ ACTOR : ${{ github.actor }}
23
25
run : |
24
- git config --global user.name ${{ github.actor }}
25
- git config --global user.email ${{ github.actor }} @users.noreply.github.com
26
+ git config --global user.name "$ACTOR"
27
+ git config --global user.email "$ACTOR" @users.noreply.github.com
26
28
- name : create a new branch that references commit id
27
- run : git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
29
+ env :
30
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
31
+ COMMIT_ID : ${{ github.event.inputs.commit_id }}
32
+ run : git checkout -b "$VERSION_NUMBER" "$COMMIT_ID"
28
33
- name : Generate SBOM
29
34
uses : FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
30
35
with :
31
36
repo_path : ./
32
37
source_path : ./source
33
38
- name : commit SBOM file
39
+ env :
40
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
34
41
run : |
35
42
git add .
36
43
git commit -m 'Update SBOM'
37
- git push -u origin ${{ github.event.inputs.version_number }}
44
+ git push -u origin "$VERSION_NUMBER"
38
45
- name : Tag Commit and Push to remote
46
+ env :
47
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
39
48
run : |
40
- git tag ${{ github.event.inputs.version_number }} -a -m "backoffAlgorithm Library ${{ github.event.inputs.version_number }} "
49
+ git tag "$VERSION_NUMBER" -a -m "backoffAlgorithm Library $VERSION_NUMBER "
41
50
git push origin --tags
42
51
- name : Verify tag on remote
52
+ env :
53
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
54
+ COMMIT_ID : ${{ github.event.inputs.commit_id }}
43
55
run : |
44
- git tag -d ${{ github.event.inputs.version_number }}
56
+ git tag -d "$VERSION_NUMBER"
45
57
git remote update
46
- git checkout tags/${{ github.event.inputs.version_number }}
47
- git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }}
58
+ git checkout tags/"$VERSION_NUMBER"
59
+ git diff "$COMMIT_ID" tags/"$VERSION_NUMBER"
48
60
create-zip :
49
61
needs : tag-commit
50
62
name : Create ZIP and verify package for release asset.
@@ -63,21 +75,27 @@ jobs:
63
75
cd backoffAlgorithm
64
76
git submodule update --init --checkout --recursive
65
77
- name : Create ZIP
78
+ env :
79
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
66
80
run : |
67
- zip -r backoffAlgorithm-${{ github.event.inputs.version_number }} .zip backoffAlgorithm -x "*.git*"
81
+ zip -r backoffAlgorithm-"$VERSION_NUMBER" .zip backoffAlgorithm -x "*.git*"
68
82
ls ./
69
83
- name : Validate created ZIP
84
+ env :
85
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
70
86
run : |
71
87
mkdir zip-check
72
- mv backoffAlgorithm-${{ github.event.inputs.version_number }} .zip zip-check
88
+ mv backoffAlgorithm-"$VERSION_NUMBER" .zip zip-check
73
89
cd zip-check
74
- unzip backoffAlgorithm-${{ github.event.inputs.version_number }}. zip -d backoffAlgorithm-${{ github.event.inputs.version_number }}
75
- ls backoffAlgorithm-${{ github.event.inputs.version_number }}
76
- diff -r -x "*.git*" backoffAlgorithm-${{ github.event.inputs.version_number }} /backoffAlgorithm/ ../backoffAlgorithm/
90
+ unzip backoffAlgorithm-"$VERSION_NUMBER". zip -d backoffAlgorithm-"$VERSION_NUMBER"
91
+ ls backoffAlgorithm-"$VERSION_NUMBER"
92
+ diff -r -x "*.git*" backoffAlgorithm-"$VERSION_NUMBER" /backoffAlgorithm/ ../backoffAlgorithm/
77
93
cd ../
78
94
- name : Build
95
+ env :
96
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
79
97
run : |
80
- cd zip-check/backoffAlgorithm-${{ github.event.inputs.version_number }} /backoffAlgorithm
98
+ cd zip-check/backoffAlgorithm-"$VERSION_NUMBER" /backoffAlgorithm
81
99
sudo apt-get install -y lcov
82
100
cmake -S test -B build/ \
83
101
-G "Unix Makefiles" \
@@ -86,8 +104,10 @@ jobs:
86
104
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror'
87
105
make -C build/ all
88
106
- name : Test
107
+ env :
108
+ VERSION_NUMBER : ${{ github.event.inputs.version_number }}
89
109
run : |
90
- cd zip-check/backoffAlgorithm-${{ github.event.inputs.version_number }} /backoffAlgorithm/build/
110
+ cd zip-check/backoffAlgorithm-"$VERSION_NUMBER" /backoffAlgorithm/build/
91
111
ctest -E system --output-on-failure
92
112
cd ..
93
113
- name : Create artifact of ZIP
0 commit comments