Skip to content

Commit a0b421c

Browse files
authored
Fix Release workflow (#301)
* fix(workflows/release): Sync actions/upload-artifact and actions/download-artifact versions (v3) * fix(workflows/codacy-analysis): Bump codacy/codacy-analysis-cli-action to v4 and upload-sarif to v2 * fix(workflows/integration): Remove unecessary rustup installation * Run select Codacy tool in parallel
1 parent 6316838 commit a0b421c

File tree

5 files changed

+60
-40
lines changed

5 files changed

+60
-40
lines changed

.github/workflows/codacy-analysis.yml

+19-6
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,50 @@ name: Codacy Security Scan
1010

1111
on:
1212
push:
13-
branches: [ '**' ]
13+
branches: ["**"]
1414
pull_request:
15-
branches: [ '**' ]
15+
branches: ["**"]
16+
workflow_dispatch:
1617

1718
jobs:
1819
codacy-security-scan:
1920
name: Codacy Security Scan
2021
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
# List of Codacy-supported tools: https://docs.codacy.com/repositories-configure/codacy-configuration-file/#which-tools-can-be-configured-and-which-name-should-i-use%20%20tool-timeout:
25+
tool: [
26+
cppcheck, # static analysis of C/C++ code
27+
flawfinder, # a static analysis tool for finding vulnerabilities in C/C++ source code
28+
pmd, # includes CPD, the copy-paste-detector. CPD finds duplicated code in C/C++, etc
29+
markdownlint, # A Node.js style checker and lint tool for Markdown/CommonMark files
30+
shellcheck, # a static analysis tool for shell scripts
31+
pylintpython3, # a static code analyser for Python 3
32+
]
2133
steps:
2234
# Checkout the repository to the GitHub Actions runner
2335
- name: Checkout code
2436
uses: actions/checkout@v4
2537

2638
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
2739
- name: Run Codacy Analysis CLI
28-
uses: codacy/codacy-analysis-cli-action@1.1.0
40+
uses: codacy/codacy-analysis-cli-action@master
2941
with:
3042
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
3143
# You can also omit the token and run the tools that support default configurations
3244
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
3345
verbose: true
34-
output: results.sarif
46+
output: results-${{ matrix.tool }}.sarif
3547
format: sarif
3648
# Adjust severity of non-security issues
3749
gh-code-scanning-compat: true
3850
# Force 0 exit code to allow SARIF file generation
3951
# This will handover control about PR rejection to the GitHub side
4052
max-allowed-issues: 2147483647
53+
tool: cppcheck
4154

4255
# Upload the SARIF file generated in the previous step
4356
- name: Upload SARIF results file
44-
uses: github/codeql-action/upload-sarif@v1
57+
uses: github/codeql-action/upload-sarif@v2
4558
with:
46-
sarif_file: results.sarif
59+
sarif_file: results-${{ matrix.tool }}.sarif

.github/workflows/integration.yaml

+9-16
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,24 @@ name: integration
1515

1616
on:
1717
push:
18-
branches: [ '**' ]
18+
branches: ["**"]
1919
pull_request:
20-
branches: [ '**' ]
20+
branches: ["**"]
2121
schedule:
22-
- cron: '0 6 * * 1-5'
22+
- cron: "0 6 * * 1-5"
2323

2424
jobs:
2525
build:
26-
2726
name: Build on ${{ matrix.os }}
2827
runs-on: ${{ matrix.os }}
2928
strategy:
3029
fail-fast: false
3130
matrix:
32-
os: [ ubuntu-latest, macOS-latest ]
31+
os: [ubuntu-latest, macOS-latest]
3332

3433
steps:
35-
- uses: actions/checkout@v4
36-
37-
- name: Install latest stable
38-
uses: actions-rs/[email protected]
39-
with:
40-
toolchain: stable
41-
override: true
42-
components: rustfmt, clippy
34+
- name: Clone this repository
35+
uses: actions/checkout@v4
4336

4437
- name: Compile debug
4538
run: make all
@@ -52,8 +45,8 @@ jobs:
5245
- name: Test debug
5346
run: make test
5447
env:
55-
BUILD_TYPE: Debug # Workaround for Windows as it seems the previous step is being ignored
56-
BUILD_TESTING: OFF # Workaround for Windows as it seems the previous step is being ignored
57-
BUILD_MULTICAST: OFF # Workaround for Windows as it seems the previous step is being ignored
48+
BUILD_TYPE: Debug # Workaround for Windows as it seems the previous step is being ignored
49+
BUILD_TESTING: OFF # Workaround for Windows as it seems the previous step is being ignored
50+
BUILD_MULTICAST: OFF # Workaround for Windows as it seems the previous step is being ignored
5851
BUILD_INTEGRATION: ON # Workaround for Windows as it seems the previous step is being ignored
5952
ZENOH_BRANCH: master

.github/workflows/release.yml

+30-18
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
name: Preparation
2626
runs-on: ubuntu-latest
2727
steps:
28-
- uses: actions/checkout@v4
28+
- name: Clone this repository
29+
uses: actions/checkout@v4
30+
2931
- name: Environment setup
3032
id: env
3133
shell: bash
@@ -34,32 +36,32 @@ jobs:
3436
echo "GITHUB_SHA=${GITHUB_SHA:0:8}"
3537
GIT_BRANCH=`[[ $GITHUB_REF =~ ^refs/heads/.* ]] && echo ${GITHUB_REF/refs\/heads\//} || true`
3638
echo "GIT_BRANCH=${GIT_BRANCH}"
37-
echo ::set-output name=GIT_BRANCH::"${GIT_BRANCH}"
39+
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_OUTPUT
3840
GIT_TAG=`[[ $GITHUB_REF =~ ^refs/tags/.* ]] && echo ${GITHUB_REF/refs\/tags\//} || true`
3941
echo "GIT_TAG=${GIT_TAG}"
40-
echo ::set-output name=GIT_TAG::"${GIT_TAG}"
42+
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_OUTPUT
4143
4244
ZENOH_VERSION=$(sed -n 's/^project(libzenohpico VERSION \(.*\) LANGUAGES C)/\1/p' CMakeLists.txt | head -n1)
4345
echo "ZENOH_VERSION=${ZENOH_VERSION}"
44-
echo ::set-output name=ZENOH_VERSION::"${ZENOH_VERSION}"
46+
echo "ZENOH_VERSION=${ZENOH_VERSION}" >> $GITHUB_OUTPUT
4547
if [ -n "${GIT_TAG}" ]; then
4648
IS_RELEASE="true"
4749
echo "IS_RELEASE=${IS_RELEASE}"
48-
echo ::set-output name=IS_RELEASE::"${IS_RELEASE}"
50+
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
4951
PKG_VERSION=${GIT_TAG}
5052
elif [ -n "${GIT_BRANCH}" ]; then
5153
PKG_VERSION=${GIT_BRANCH}-${GITHUB_SHA:0:8}
5254
else
5355
PKG_VERSION=${ZENOH_VERSION}-${GITHUB_SHA:0:8}
5456
fi
5557
echo "PKG_VERSION=${PKG_VERSION}"
56-
echo ::set-output name=PKG_VERSION::"${PKG_VERSION}"
58+
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_OUTPUT
5759
5860
CROSSBUILD_TARGETS=$(sed -n 's/^CROSSBUILD_TARGETS=\(.*\)/\1/p' GNUmakefile | head -n1)
5961
echo "CROSSBUILD_TARGETS=$CROSSBUILD_TARGETS"
6062
TARGET_MATRIX="{\"target\": [\"${CROSSBUILD_TARGETS// /\",\"}\"]}"
6163
echo "TARGET_MATRIX=$TARGET_MATRIX"
62-
echo ::set-output name=TARGET_MATRIX::"${TARGET_MATRIX}"
64+
echo "TARGET_MATRIX=$TARGET_MATRIX" >> $GITHUB_OUTPUT
6365
outputs:
6466
GIT_BRANCH: ${{ steps.env.outputs.GIT_BRANCH }}
6567
GIT_TAG: ${{ steps.env.outputs.GIT_TAG }}
@@ -73,11 +75,14 @@ jobs:
7375
needs: preps
7476
runs-on: macos-latest
7577
steps:
76-
- uses: actions/checkout@v4
78+
- name: Clone this repository
79+
uses: actions/checkout@v4
80+
7781
- name: MacOS build
7882
run: make
7983
env:
8084
BUILD_TYPE: RELEASE
85+
8186
- name: Packaging
8287
id: package
8388
shell: bash
@@ -86,14 +91,15 @@ jobs:
8691
echo "Packaging ${LIB_PKG_NAME}:"
8792
cd build && zip -r ${LIB_PKG_NAME} lib && cd -
8893
zip -r ${LIB_PKG_NAME} include
89-
echo ::set-output name=LIB_PKG_NAME::"${LIB_PKG_NAME}"
94+
echo "LIB_PKG_NAME=${LIB_PKG_NAME}" >> $GITHUB_OUTPUT
9095
9196
EXP_PKG_NAME=${PWD}/zenoh-pico-${{ needs.preps.outputs.PKG_VERSION }}-macos-x64-examples.zip
9297
echo "Packaging ${EXP_PKG_NAME}:"
9398
cd build/examples && zip ${EXP_PKG_NAME} * && cd -
94-
echo ::set-output name=EXP_PKG_NAME::"${EXP_PKG_NAME}"
99+
echo "EXP_PKG_NAME=${EXP_PKG_NAME}" >> $GITHUB_OUTPUT
100+
95101
- name: "Upload x86_64 macos package"
96-
uses: actions/upload-artifact@master
102+
uses: actions/upload-artifact@v3
97103
with:
98104
name: macos-x64
99105
path: |
@@ -108,11 +114,14 @@ jobs:
108114
fail-fast: false
109115
matrix: ${{fromJson(needs.preps.outputs.TARGET_MATRIX)}}
110116
steps:
111-
- uses: actions/checkout@v4
117+
- name: Clone this repository
118+
uses: actions/checkout@v4
119+
112120
- name: make for ${{ matrix.target }}
113121
env:
114122
BUILD_TYPE: RELEASE
115123
run: make ${{ matrix.target }}
124+
116125
- name: Packaging
117126
id: package
118127
shell: bash
@@ -126,22 +135,23 @@ jobs:
126135
echo "Packaging ${LIB_PKG_NAME}:"
127136
cd crossbuilds/${TARGET} && zip -r ${LIB_PKG_NAME} lib && cd -
128137
zip -r ${LIB_PKG_NAME} include
129-
echo ::set-output name=LIB_PKG_NAME::"${LIB_PKG_NAME}"
138+
echo "LIB_PKG_NAME=${LIB_PKG_NAME}" >> $GITHUB_OUTPUT
130139
131140
cd crossbuilds/${TARGET}/packages
132141
echo "Packaging ${DEB_PKG_NAME}:"
133142
zip ${DEB_PKG_NAME} *.deb
134-
echo ::set-output name=DEB_PKG_NAME::"${DEB_PKG_NAME}"
143+
echo "DEB_PKG_NAME=${DEB_PKG_NAME}" >> $GITHUB_OUTPUT
135144
echo "Packaging ${RPM_PKG_NAME}:"
136145
zip ${RPM_PKG_NAME} *.rpm
137-
echo ::set-output name=RPM_PKG_NAME::"${RPM_PKG_NAME}"
146+
echo "RPM_PKG_NAME=${RPM_PKG_NAME}" >> $GITHUB_OUTPUT
138147
cd -
139148
140149
echo "Packaging ${EXP_PKG_NAME}:"
141150
cd crossbuilds/${TARGET}/examples && zip ${EXP_PKG_NAME} * && cd -
142-
echo ::set-output name=EXP_PKG_NAME::"${EXP_PKG_NAME}"
151+
echo "EXP_PKG_NAME=${EXP_PKG_NAME}" >> $GITHUB_OUTPUT
152+
143153
- name: "Upload packages"
144-
uses: actions/upload-artifact@master
154+
uses: actions/upload-artifact@v3
145155
with:
146156
name: ${{ matrix.target }}
147157
path: |
@@ -157,13 +167,15 @@ jobs:
157167
runs-on: ubuntu-latest
158168
steps:
159169
- name: Download result of previous builds
160-
uses: actions/download-artifact@v2
170+
uses: actions/download-artifact@v3
161171
with:
162172
path: ARTIFACTS
173+
163174
- name: Publish as github release
164175
uses: softprops/action-gh-release@v1
165176
with:
166177
files: ARTIFACTS/*/*.*
178+
167179
- name: Publish to download.eclipse.org/zenoh
168180
env:
169181
SSH_TARGET: [email protected]

tests/api.sh

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if [ ! -f zenohd ]; then
3434
if [ -n "$ZENOH_BRANCH" ]; then
3535
git switch "$ZENOH_BRANCH"
3636
fi
37+
rustup show
3738
cargo build --lib --bin zenohd
3839
cp ./target/debug/zenohd "$TESTDIR"/
3940
cd "$TESTDIR"|| exit

tests/routed.sh

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if [ ! -f zenohd ]; then
3434
if [ -n "$ZENOH_BRANCH" ]; then
3535
git switch "$ZENOH_BRANCH"
3636
fi
37+
rustup show
3738
cargo build --lib --bin zenohd
3839
cp ./target/debug/zenohd "$TESTDIR"/
3940
cd "$TESTDIR" || exit

0 commit comments

Comments
 (0)