diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml new file mode 100644 index 00000000000..3d01a14b8e1 --- /dev/null +++ b/.github/actions/install-dependencies/action.yml @@ -0,0 +1,10 @@ +name: 'Install dependencies' +description: 'Install dependencies to build sssd' +runs: + using: "composite" + steps: + - shell: bash + run: | + cd contrib/ci/ + . deps.sh + deps_install diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml new file mode 100644 index 00000000000..b908748cc3c --- /dev/null +++ b/.github/workflows/static-code-analysis.yml @@ -0,0 +1,42 @@ +name: "Static code analysis" +on: + push: + branches: [master] + pull_request: + branches: [master] + schedule: + # Everyday at midnight + - cron: '0 0 * * *' + +jobs: + codeql: + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install dependencies + id: dependencies + uses: ./.github/actions/install-dependencies + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + queries: +security-and-quality + + - name: Compile sssd + run: | + source contrib/fedora/bashrc_sssd + cd contrib/ci/ + . configure.sh + cd ../.. + reconfig "${CONFIGURE_ARG_LIST[@]}" + PROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN) + make -j$PROCESSORS + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + with: + languages: cpp, python