Coverity Scan #1328
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Coverity Scan | |
| on: | |
| schedule: | |
| - cron: '0 18 * * *' # Daily at 18:00 UTC | |
| workflow_dispatch: | |
| jobs: | |
| latest: | |
| if: (github.event_name == 'schedule' && github.repository == 'Cytnx-dev/Cytnx') || (github.event_name != 'schedule') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| # Specify python version your environment will have. Remember to quote this, or | |
| # YAML will think you want python 3.1 not 3.10 | |
| python-version: "3.11" | |
| # This uses *miniforge*, rather than *minicond*. The primary difference is that | |
| # the defaults channel is not enabled at all | |
| miniforge-version: latest | |
| # These properties enable the use of mamba, which is much faster and far less error | |
| # prone than conda while being completely compatible with the conda CLI | |
| use-mamba: true | |
| mamba-version: "*" | |
| - name: Install dependencies | |
| shell: bash -l {0} | |
| run: | | |
| mamba install cmake make boost compilers blas=*=mkl pybind11 arpack | |
| cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_INSTALL_PREFIX=/home/runner/works/Cytnx_lib --preset=mkl-cpu | |
| - name: Download Coverity Build Tool | |
| shell: bash -l {0} | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=Cytnx-dev%2FCytnx" -O cov-analysis-linux64.tar.gz | |
| mkdir cov-analysis-linux64 | |
| tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 | |
| env: | |
| TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
| - name: Build with cov-build | |
| shell: bash -l {0} | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| export PATH=`pwd`/cov-analysis-linux64/bin:$PATH | |
| cmake --version | |
| cov-build --dir cov-int cmake --build . -j `nproc` | |
| - name: Submit the result to Coverity Scan | |
| shell: bash -l {0} | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| tar czvf cytnx.tgz cov-int | |
| curl \ | |
| --form token=$TOKEN \ | |
| --form email=kaihsinwu@gmail.com \ | |
| --form file=@cytnx.tgz \ | |
| --form version="v0.9.x" \ | |
| --form description="Cytnx" \ | |
| https://scan.coverity.com/builds?project=Cytnx-dev%2FCytnx | |
| env: | |
| TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |