diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b6b48a..3ebc5db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,34 +7,46 @@ on: branches: [ "main" ] jobs: - build-parcer: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v4 with: go-version: '1.22.2' - - name: Build + - name: Build JSON Parser working-directory: ./parser run: GOOS=js GOARCH=wasm go build -v . - - name: Test + - name: Test JSON Parser working-directory: ./parser run: go test -v ./core/... - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - name: Use Node.js uses: actions/setup-node@v3 with: node-version: 20.x cache: 'yarn' - - run: yarn install --immutable - - run: yarn lint - - run: yarn build:production - - run: yarn test + + - name: Install dependencies + run: yarn install --immutable + + - name: Lint + run: yarn lint + + - name: Build + run: yarn build:production + + - name: Test + run: yarn test + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..416bc1e --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=evg4b_modern-json-formatter +sonar.organization=evg4b +sonar.projectName=Modern JSON Formatter +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. +sonar.sourceEncoding=UTF-8