diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9d38d03 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +on: + # Trigger analysis when pushing in master or pull requests, and when creating + # a pull request. + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +name: Build, Test and Analyze +jobs: + build: + name: Build, Test and Analyze + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Install dependencies + run: npm install + - name: Run Build + run: npm build + - name: Run tests + run: npm run test:coverage + - name: Run Coverage + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 409a7b9..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: - # Trigger analysis when pushing in master or pull requests, and when creating - # a pull request. - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened] -name: Main Workflow -jobs: - sonarcloud: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}