From 205be2cf0098bba0901bb350b53b7249fb8f136b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Sun, 20 Nov 2022 12:36:00 -0500 Subject: [PATCH] chore(ci): add commitlint step to checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): dereference git branches Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): debug git dir Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): fetch refs Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): fix commitlint Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): remove cat Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): git fetch all Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): ffs Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): ffs 2 Signed-off-by: Ricardo Arturo Cabral Mejía chore(ci): fix commitlint step Signed-off-by: Ricardo Arturo Cabral Mejía --- .github/workflows/checks.yml | 67 +++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c1adf4e..5991574 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,11 +11,28 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint + commit-lint: + name: Lint commits runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: npm + - name: Install package dependencies + run: npm ci + - name: Run commitlint + run: npx commitlint --from=origin/$GITHUB_BASE_REF + lint: + name: Lint code + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: .nvmrc @@ -28,7 +45,8 @@ jobs: name: Build check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: .nvmrc @@ -40,8 +58,13 @@ jobs: test-units-and-cover: name: Unit Tests And Coverage runs-on: ubuntu-latest + needs: + - commit-lint + - lint + - build-check steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: .nvmrc @@ -70,11 +93,12 @@ jobs: name: Integration Tests and Coverage runs-on: ubuntu-latest needs: + - commit-lint - lint - build-check - - test-units-and-cover steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: .nvmrc @@ -107,18 +131,19 @@ jobs: needs: [test-units-and-cover, test-integrations-and-cover] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/download-artifact@v3 - name: Download unit & integration coverage reports - with: - path: .coverage - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v3 + name: Download unit & integration coverage reports + with: + path: .coverage + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} post-tests: name: Post Tests needs: [test-units-and-cover, test-integrations-and-cover] @@ -133,14 +158,14 @@ jobs: release: name: Release runs-on: ubuntu-latest - needs: [test-integrations-and-cover] + needs: [test-units-and-cover, test-integrations-and-cover] if: github.ref == 'refs/heads/main' environment: release env: TELEGRAM_BOT_ID: ${{ secrets.TELEGRAM_BOT_ID }} TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: