Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: cleanup coverity workflow #977

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 57 additions & 40 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,65 @@
name: Coverity
# GitHub Actions workflow to run Coverity scans.
name: "Coverity"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * *" # At 00:00 daily.

jobs:
scan:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'libressl' }}
name: "Scan"
runs-on: "ubuntu-latest"
if: github.repository_owner == 'libressl' # Prevent running on forks
permissions:
contents: read
steps:
- uses: actions/checkout@main
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Download Coverity build tool
run: |
wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=libressl-portable%2Fportable" -O coverity_tool.tar.gz
mkdir coverity_tool
tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool
- name: Configure
run: |
./autogen.sh
./configure
make dist
tar zxf libressl-*.tar.gz
rm libressl-*.tar.gz
cd libressl-*
mkdir build-static
mkdir build-shared
cmake -GNinja -DBUILD_SHARED_LIBS=ON ..
- name: Build with Coverity build tool
run: |
export PATH=`pwd`/coverity_tool/bin:$PATH
cd libressl-*
cov-build --dir cov-int ninja
- name: Submit build result to Coverity Scan
run: |
cd libressl-*
tar czvf cov.tar.gz cov-int
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
--form [email protected] \
--form [email protected] \
--form version="Commit $GITHUB_SHA" \
--form description="Build submitted via CI" \
https://scan.coverity.com/builds?project=libressl-portable%2Fportable
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build

- name: "Download Coverity build tool"
env:
PROJECT: "libressl-portable%2Fportable"
COVERITY_SCAN_TOKEN: "${{ secrets.COVERITY_SCAN_TOKEN }}"
run: |
wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$PROJECT" -O coverity_tool.tar.gz
mkdir coverity_tool
tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool

- name: "Setup"
run: |
./autogen.sh
./configure
make dist
tar zxf libressl-*.tar.gz
rm libressl-*.tar.gz
cd libressl-*
mkdir build-static
mkdir build-shared
cmake -GNinja -DBUILD_SHARED_LIBS=ON ..

- name: "Build with Coverity build tool"
run: |
export PATH=`pwd`/coverity_tool/bin:$PATH
cd libressl-*
cov-build --dir cov-int ninja

- name: "Submit build result to Coverity Scan"
env:
EMAIL: "[email protected]"
PROJECT: "libressl-portable%2Fportable"
COVERITY_SCAN_TOKEN: "${{ secrets.COVERITY_SCAN_TOKEN }}"
run: |
cd libressl-*
tar czvf cov.tar.gz cov-int
curl --form token=$COVERITY_SCAN_TOKEN \
--form email=$EMAIL \
--form [email protected] \
--form version="Commit $GITHUB_SHA" \
--form description="Build submitted via CI" \
https://scan.coverity.com/builds?project=$PROJECT