diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b8c7b42..462e95c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,42 +3,51 @@ name: Buld and test on: push: branches: [master, development] + jobs: - checkoutAndInstallDeno: - name: Checkout and install deno - runs-on: ubuntu-latest - permissions: - 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" sonarcloud: name: SonarCloud runs-on: ubuntu-latest - needs: checkoutAndInstallDeno + needs: build + permissions: + id-token: write # Needed for auth with Deno Deploy + contents: read # Needed to clone the repository 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 }} + - 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 }} build: - 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" + 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