From c8f1dc6e3c1e4b002240045b26eb86a38f1275b2 Mon Sep 17 00:00:00 2001 From: Gabriel Csollei Date: Fri, 11 Oct 2024 12:18:26 +0000 Subject: [PATCH] Split jobs --- .github/workflows/build-and-test.yml | 74 +++++++++++++--------------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2e38c65e..b8c7b42f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,50 +3,42 @@ name: Buld and test on: push: branches: [master, development] - jobs: - sonarcloud: - name: SonarCloud + checkoutAndInstallDeno: + name: Checkout and install deno runs-on: ubuntu-latest permissions: - id-token: write # Needed for auth with Deno Deploy contents: read # Needed to clone the repository steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Install Deno - uses: denoland/setup-deno@v1 - with: - deno-version: v2.x - - name: Run tests with coverage - run: "deno task test:coverage" - - name: Generate coverage - run: "deno task coverage:lcov" - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v2.x + - name: Run tests with coverage + run: "deno task test:coverage" + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + needs: checkoutAndInstallDeno + steps: + - name: Generate coverage + run: "deno task coverage:lcov" + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} build: - name: Build - runs-on: ubuntu-latest - - permissions: - id-token: write # Needed for auth with Deno Deploy - contents: read # Needed to clone the repository - - steps: - - name: Clone repository - uses: actions/checkout@v3 - - - name: Install Deno - uses: denoland/setup-deno@v1 - with: - deno-version: v2.x - - name: Lint step - run: "deno lint" - - name: Check step - run: "deno task check" - - name: Test step - run: "deno task test" \ No newline at end of file + name: Build + runs-on: ubuntu-latest + needs: checkoutAndInstallDeno + steps: + - name: Lint step + run: "deno lint" + - name: Check step + run: "deno task check" + - name: Test step + run: "deno task test"