diff --git a/.github/workflows/integration_tests.yaml.yml b/.github/workflows/integration_tests.yml similarity index 97% rename from .github/workflows/integration_tests.yaml.yml rename to .github/workflows/integration_tests.yml index 78398903..84341b12 100644 --- a/.github/workflows/integration_tests.yaml.yml +++ b/.github/workflows/integration_tests.yml @@ -1,7 +1,16 @@ name: Run integration tests on a DUT via testflinger on: + workflow_call: workflow_dispatch: - pull_request: + # pull_request: + # branches: + # - main + # types: + # - opened + # - reopened + # - synchronize + # - ready_for_review + # - labeled jobs: binary-integration-tests: name: Build and Test the Daemon Binary on DUT diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b55dec33..12544b4b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -166,3 +166,34 @@ jobs: echo "::group::unit test results" cargo test --bins echo "::endgroup::" + tics: + if: false # disabled until we get confirmation + permissions: + contents: read + issues: write + pull-requests: write + runs-on: ubuntu-latest + env: + TICS_CHANGED_LIST: tics_changed.list + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get PR files + env: + PR_NUMBER: ${{ github.event.number }} + run: | + gh pr diff "$PR_NUMBER" --name-only >> "$TICS_CHANGED_LIST" + echo "::group::===== Changed Files =====" + cat "$TICS_CHANGED_LIST" + echo "::endgroup::" + - name: Run TICS analysis + uses: tiobe/tics-github-action@v3.4.0 + with: + mode: client + project: fpgad + viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default + ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }} + installTics: true + filelist: ${{ env.TICS_CHANGED_LIST }} diff --git a/.github/workflows/tics_scan.yml b/.github/workflows/tics_scan.yml new file mode 100644 index 00000000..6154345e --- /dev/null +++ b/.github/workflows/tics_scan.yml @@ -0,0 +1,53 @@ +name: TiCS Scan +on: + pull_request: + schedule: + - cron: '17 1 * * 0' # Runs at 01:17 (UTC) on Sunday +jobs: + integration-tests: + secrets: inherit + uses: ./.github/workflows/integration_tests.yml + TICS: + permissions: + contents: read + issues: write + pull-requests: write + needs: + - integration-tests + runs-on: [self-hosted, amd64, tiobe] + env: + GH_TOKEN: ${{ github.token }} + DEBIAN_FRONTEND: noninteractive + COVERAGE_DIR: ${{ github.workspace }}/${{ vars.TICS_COVERAGE_DIR || 'coverage' }} + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + name: llvm-cov-artifacts + path: artifacts + - uses: actions-rust-lang/setup-rust-toolchain@v1.15 + - name: Build + run: | + rustup component add clippy + cargo clippy + cargo build --workspace -v + - name: Move coverage results for TICS + shell: bash + run: | + find ./artifacts + echo "COVERAGE_DIR=${COVERAGE_DIR}" + mkdir -p "$COVERAGE_DIR" + mv -v ./artifacts/*.lcov "$COVERAGE_DIR/" + - name: Run TICS analysis + uses: tiobe/tics-github-action@v3.5.0 + with: + mode: qserver + project: fpgad + viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default + branchdir: ${{ github.workspace }} + ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }} + installTics: true diff --git a/tests/coverage_test.sh b/tests/coverage_test.sh index b8a23b60..15731886 100755 --- a/tests/coverage_test.sh +++ b/tests/coverage_test.sh @@ -12,7 +12,7 @@ # # You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. -set -xeu +set -x # Enable llvm-coverage build results eval "$(cargo llvm-cov show-env --export-prefix)"