Bump paambaati/codeclimate-action from v5.0.0 to v8.0.0 in ci GA work… #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
branches: | |
- develop | |
- main | |
permissions: read-all | |
env: | |
NODE_VERSION: 20.15.1 | |
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | |
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }} | |
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
id: node | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Send Slack notification | |
uses: codedsolar/[email protected] | |
if: ${{ github.event_name != 'pull_request' }} | |
id: slack | |
with: | |
fields: | | |
{STATUS} | |
{REF} | |
Node.js: ${{ steps.node.outputs.node-version }} | |
status: in-progress | |
- name: Enable corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: yarn install --ignore-scripts | |
env: | |
NODE_ENV: development | |
- name: Build | |
run: yarn build | |
env: | |
NODE_ENV: production | |
- name: Update Slack notification | |
uses: codedsolar/[email protected] | |
if: ${{ github.event_name != 'pull_request' && always() }} | |
with: | |
fields: | | |
{STATUS} | |
{REF} | |
Node.js: ${{ steps.node.outputs.node-version }} | |
status: ${{ job.status }} | |
timestamp: ${{ steps.slack.outputs.slack-timestamp }} | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
id: node | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Send Slack notification | |
uses: codedsolar/[email protected] | |
if: ${{ github.event_name != 'pull_request' }} | |
id: slack | |
with: | |
fields: | | |
{STATUS} | |
{REF} | |
Node.js: ${{ steps.node.outputs.node-version }} | |
ESLint issues: Checking... | |
Prettier issues: Checking... | |
status: in-progress | |
- name: Enable corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: yarn install --ignore-scripts | |
env: | |
NODE_ENV: development | |
- name: Lint using ESLint | |
run: yarn lint:eslint || true | |
- name: Output ESLint results | |
id: eslint-output | |
run: yarn ci:eslint || true | |
- name: Lint using Prettier | |
run: yarn lint:prettier || true | |
- name: Output Prettier results | |
id: prettier-output | |
run: yarn ci:prettier || true | |
- name: Check results | |
run: | | |
eslint_issues="${{ steps.eslint-output.outputs.issues }}" | |
prettier_issues="${{ steps.prettier-output.outputs.issues }}" | |
echo "Total ESLint issues: $eslint_issues" | |
echo "Total Prettier issues: $prettier_issues" | |
exit_code=1 | |
if [ "$eslint_issues" = '0' ] && [ "$prettier_issues" = '0' ]; then | |
exit_code=0 | |
fi | |
exit "$exit_code" | |
- name: Update Slack notification | |
uses: codedsolar/[email protected] | |
if: ${{ github.event_name != 'pull_request' && always() }} | |
with: | |
fields: | | |
{STATUS} | |
{REF} | |
Node.js: ${{ steps.node.outputs.node-version }} | |
ESLint issues: ${{ steps.eslint-output.outputs.issues || 'Skipped' }} | |
Prettier issues: ${{ steps.prettier-output.outputs.issues || 'Skipped' }} | |
status: ${{ job.status }} | |
timestamp: ${{ steps.slack.outputs.slack-timestamp }} | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
id: node | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Send Slack notification | |
uses: codedsolar/[email protected] | |
if: ${{ github.event_name != 'pull_request' }} | |
id: slack | |
with: | |
fields: | | |
{STATUS} | |
{REF} | |
Node.js: ${{ steps.node.outputs.node-version }} | |
Passed Jest tests: Testing... | |
status: in-progress | |
- name: Enable corepack | |
run: corepack enable | |
- name: Install dependencies | |
run: yarn install --ignore-scripts | |
env: | |
NODE_ENV: development | |
- name: Test using Jest | |
id: jest | |
run: yarn test:jest || true | |
- name: Output Jest results | |
id: jest-output | |
run: yarn ci:jest || true | |
- name: Check results | |
run: | | |
jest_passed="${{ steps.jest-output.outputs.passed }}" | |
jest_total="${{ steps.jest-output.outputs.total }}" | |
echo "Passed Jest tests: $jest_passed" | |
echo "Total Jest tests: $jest_total" | |
exit_code=1 | |
if [ "$jest_passed" = "$jest_total" ]; then | |
exit_code=0 | |
fi | |
exit "$exit_code" | |
- name: Send Codecov report | |
if: ${{ !env.ACT && github.event_name != 'pull_request' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Send Code Climate report | |
uses: paambaati/[email protected] | |
if: ${{ !env.ACT && github.event_name != 'pull_request' }} | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: yarn test | |
- name: Update Slack notification | |
uses: codedsolar/[email protected] | |
if: ${{ github.event_name != 'pull_request' && always() }} | |
with: | |
fields: | | |
{STATUS} | |
{REF} | |
Node.js: ${{ steps.node.outputs.node-version }} | |
Passed Jest tests: ${{ steps.jest-output.outputs.passed || '-' }} / ${{ steps.jest-output.outputs.total || '-' }} | |
status: ${{ job.status }} | |
timestamp: ${{ steps.slack.outputs.slack-timestamp }} |