From 7286135399b2e15d373642cb8164267ef7a7da98 Mon Sep 17 00:00:00 2001 From: Gabriel Kihlman Date: Mon, 9 Dec 2019 13:12:37 +0100 Subject: [PATCH] Adding a static code analysis github workflow --- .github/workflows/scan.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/scan.yml diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml new file mode 100644 index 0000000..d99b327 --- /dev/null +++ b/.github/workflows/scan.yml @@ -0,0 +1,32 @@ +name: static code analysis + +on: [push] +env: + SCAN_IMG: + yes-docker-local.artifactory.in.yubico.org/static-code-analysis/c:v1 + COMPILE_DEPS: "libykclient-dev libykpers-1-dev libyubikey-dev" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Prep scan + run: | + docker login yes-docker-local.artifactory.in.yubico.org/ \ + -u svc-static-code-analysis-reader \ + -p ${{ secrets.ARTIFACTORY_READER_TOKEN }} + docker pull ${SCAN_IMG} + + - name: Scan and fail if warnings + run: | + docker run -v${PWD}:/k -e COMPILE_DEPS="${COMPILE_DEPS}" \ + -e PROJECT_NAME=${GITHUB_REPOSITORY#Yubico/} -t ${SCAN_IMG} + + - uses: actions/upload-artifact@master + if: failure() + with: + name: suppression_files + path: suppression_files