Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @quickcase/dev
/.github/ @quickcase/ops
83 changes: 14 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- cron: '0 0 * * *'
permissions:
contents: read
env:
NODE_VERSION: 20

jobs:
quality_checks:
name: Quality checks
Expand All @@ -20,10 +23,10 @@ jobs:
node: [16, 18, 20]
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
uses: actions/checkout@v6

- name: Setup NodeJS ${{ matrix.node }}
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: 'npm'
Expand All @@ -39,12 +42,12 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
uses: actions/checkout@v6

- name: Setup NodeJS 20
uses: actions/setup-node@v4.0.2
- name: Setup NodeJS
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Audit dependencies
Expand All @@ -57,7 +60,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
uses: actions/checkout@v6

- name: Lint Code Base
uses: github/super-linter/slim@v5
Expand All @@ -76,12 +79,12 @@ jobs:
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
uses: actions/checkout@v6

- name: Setup NodeJS 20
uses: actions/setup-node@v4.0.2
- name: Setup NodeJS
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url: https://registry.npmjs.org
scope: '@quickcase'
Expand All @@ -96,61 +99,3 @@ jobs:
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

end:
name: End
needs: [quality_checks, security_checks, lint, publish]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
steps:
- name: Build summary
id: summary
env:
QUALITY: ${{ needs.quality_checks.result }}
SECURITY: ${{ needs.security_checks.result }}
LINT: ${{ needs.lint.result }}
PUBLISH: ${{ needs.publish.result }}
run: |
echo "success=$(if [[ "$QUALITY$SECURITY$LINT$PUBLISH" =~ ^(success|skipped)+$ ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT
- name: Notify slack fail
if: steps.summary.outputs.success != 'true' && env.SLACK_BOT_TOKEN != 0
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: dev
payload: |
{
"text": "${{github.repository}}: CI failed",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"emoji": true,
"text": ":x: ${{github.repository}}: CI failed"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Repository: <${{github.server_url}}/${{github.repository}}|${{github.repository}}>"
},
{
"type": "mrkdwn",
"text": "Triggered by: *${{github.triggering_actor}}*"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "See failed run: <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}|${{github.run_id}}>"
}
}
]
}