Skip to content

Commit

Permalink
Rever split jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
G43riko committed Oct 11, 2024
1 parent c8f1dc6 commit 6fd37fe
Showing 1 changed file with 42 additions and 33 deletions.
75 changes: 42 additions & 33 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 6fd37fe

Please sign in to comment.