Skip to content

Commit

Permalink
Merge pull request #46 from xmidt-org/update-workflows
Browse files Browse the repository at this point in the history
Update workflows
  • Loading branch information
schmidtw authored Dec 22, 2021
2 parents f53c3bc + 288fd14 commit 4b4eff9
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 380 deletions.
27 changes: 0 additions & 27 deletions .github/scripts/get_coverity.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .github/scripts/get_sonarcloud.sh

This file was deleted.

100 changes: 0 additions & 100 deletions .github/scripts/make_release_artifacts.sh

This file was deleted.

29 changes: 3 additions & 26 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name: LGTM Analysis
on:
create:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -14,29 +16,4 @@ on:

jobs:
codeql:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Install the dependent packages
- name: Install packages
run: |
sudo apt update
sudo apt-get -y install python3 python3-pip python3-setuptools python3-wheel ninja-build
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev gcovr
sudo apt-get -y install libcjson-dev libcurl4-openssl-dev
pip3 install --user meson
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: cpp
queries: security-extended

- run: |
meson build
cd build
ninja all
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: xmidt-org/.github/.github/workflows/codeql-c-analysis.yml@main
74 changes: 9 additions & 65 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,15 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
schedule:
- cron: '12 9 * * 3'

jobs:
test:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Update packages
run: |
sudo apt update
- name: Install packages
run: |
sudo apt-get -y install python3 python3-pip python3-setuptools python3-wheel ninja-build
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev gcovr
sudo apt-get -y install libcjson-dev libcurl4-openssl-dev
- name: Install Meson
run: pip3 install --user meson

- name: Make Build Directory
run: mkdir build

- name: Coverity Download
working-directory: build
env:
COVERITY_SECRET: ${{ secrets.COVERITY_KEY }}
run: |
../.github/scripts/get_coverity.sh $COVERITY_SECRET $GITHUB_REPOSITORY
- name: Meson Build
run: |
meson build
- name: Prebuild
working-directory: build
run: |
ninja all
- name: Clean
working-directory: build
run: |
ninja clean
- name: Coverity Analysis
working-directory: build
run: |
./coverity/bin/cov-build --dir cov-int ninja libcjwt.so
- name: Archive Results
working-directory: build
run: |
tar czvf coverity.tgz cov-int
- name: Upload Results
working-directory: build
env:
COVERITY_SECRET: ${{ secrets.COVERITY_KEY }}
run: |
curl --form token=$COVERITY_SECRET \
--form [email protected] \
--form [email protected] \
--form version="$GITHUB_SHA" \
--form description="`date`" \
"https://scan.coverity.com/builds?project=${GITHUB_REPOSITORY//\//\%2F}"
uses: xmidt-org/.github/.github/workflows/meson-coverity.yml@main
with:
repo: $GITHUB_REPOSITORY
sha: $GITHUB_SHA
packages: libcjson-dev libcurl4-openssl-dev
secrets:
coverity_key: ${{ secrets.COVERITY_KEY }}
72 changes: 8 additions & 64 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,70 +16,14 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
schedule:
- cron: '12 9 * * 3'

jobs:
test:
name: Unit Tests
runs-on: [ ubuntu-latest ]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Update packages
run: |
sudo apt update
- name: Install packages
run: |
sudo apt-get -y install python3 python3-pip python3-setuptools python3-wheel ninja-build
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev gcovr
sudo apt-get -y install libcjson-dev libcurl4-openssl-dev
pip install codecov
- name: Install Meson
run: |
pip3 install --user 'meson>=0.59.0'
- name: Make Build Directory
run: mkdir build

- name: Get Sonarcloud Binaries
working-directory: build
run: |
../.github/scripts/get_sonarcloud.sh
- name: Meson Build
run: |
meson build
- name: Build
working-directory: build
run: |
build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output ninja all
- name: Test
working-directory: build
run: |
ninja test
- name: Coverage Report Generation
working-directory: build
run: |
ninja coverage
#ninja coverage-sonarqube ## for now this isn't supported
gcovr --sonarqube sonarqube.xml -r ..
- name: Upload SonarCloud
run: |
build/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dproject.settings=.sonar-project.properties -Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Codecov.io
uses: codecov/codecov-action@v2
with:
directory: .
files: build/meson-logs/coverage.xml
fail_ci_if_error: true
uses: xmidt-org/.github/.github/workflows/meson-unit-test.yml@main
with:
packages: libcjson-dev libcurl4-openssl-dev
secrets:
sonar_login: ${{ secrets.SONAR_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 4b4eff9

Please sign in to comment.