From 9f55b76d814feccb2657b2fd05569ae12c25ab81 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Tue, 16 Apr 2024 00:43:56 +0200 Subject: [PATCH] Test trunk-io services (#573) --- .dockerignore | 1 + .github/workflows/tests.yaml | 9 +++++++++ .github/workflows/trunk-check.yaml | 10 +++++++++- .gitignore | 1 + pyproject.toml | 2 +- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5478871e..5be3bc35 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,3 +11,4 @@ site coverage.xml config.yaml* .env +.reports diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d0d0f63d..2a22ee38 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -27,6 +27,7 @@ jobs: env: REDIS_OM_URL: redis://localhost:6379/0 GITHUB_BASE_URL: http://localhost:4010 + TRUNK_TOKEN: ${{ secrets.TRUNK_TOKEN }} steps: - uses: actions/checkout@v4 - name: Boot compose services @@ -48,6 +49,14 @@ jobs: name: ${{ matrix.test.name }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload results + if: "!cancelled() && env.TRUNK_TOKEN" + uses: trunk-io/analytics-uploader@main + with: + junit-paths: .reports/*.xml + org-slug: ${{ github.repository_owner }} + token: ${{ env.TRUNK_TOKEN }} + continue-on-error: true - name: Dump logs run: docker compose --profile tests logs if: always() diff --git a/.github/workflows/trunk-check.yaml b/.github/workflows/trunk-check.yaml index 974d5842..5cc64ced 100644 --- a/.github/workflows/trunk-check.yaml +++ b/.github/workflows/trunk-check.yaml @@ -1,7 +1,13 @@ --- name: Trunk Check -on: [pull_request] +on: + pull_request: + branches: + - main + push: + branches: + - main concurrency: group: ${{ github.head_ref || github.run_id }} @@ -27,3 +33,5 @@ jobs: - run: poetry install - name: Trunk Check uses: trunk-io/trunk-action@v1 + with: + trunk-token: ${{ secrets.TRUNK_TOKEN }} diff --git a/.gitignore b/.gitignore index fd664e3f..1574dea4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ site coverage.xml config.yaml .env +.reports diff --git a/pyproject.toml b/pyproject.toml index be859ce8..31b2464c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] -addopts = "--disable-warnings --cov=runner_manager --cov-report=xml" +addopts = "--disable-warnings --cov=runner_manager --cov-report=xml --junitxml=.reports/junit.xml" # Add poetry scripts [tool.poetry.scripts]