-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from corva-ai/chore-test
feat: add package-version output [CINF-3582]
- Loading branch information
Showing
16 changed files
with
1,966 additions
and
125,311 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "Setup Environment" | ||
|
||
description: "Setup build environment and NodeJS" | ||
|
||
inputs: | ||
build: | ||
description: "Whether to execute build step." | ||
required: false | ||
default: "true" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node environment | ||
uses: actions/setup-node@v4.0.3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Cache NodeJS dependencies | ||
uses: actions/cache@v4.0.2 | ||
id: nodejs-cache | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ runner.arch }}-npm-${{ hashFiles('./yarn.lock') }} | ||
- name: Install NodeJS dependencies | ||
shell: bash | ||
if: ${{ steps.nodejs-cache.outputs.cache-hit != 'true' }} | ||
run: npm ci | ||
- name: Build project | ||
if: ${{ inputs.build == 'true' }} | ||
shell: bash | ||
run: | | ||
npm run build | ||
npm run package |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
name: 'Code Analysis' | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
push: | ||
branches: | ||
- develop | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
actions: read | ||
checks: write | ||
statuses: write | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Load secrets from 1Password | ||
uses: 1password/load-secrets-action@v2.0.0 | ||
id: secrets | ||
with: | ||
export-env: false | ||
env: | ||
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_RO }} | ||
# | ||
APP_ID: 'op://GitHub.Actions/GitHub/corva-bot/APP_ID' | ||
PRIVATE_KEY: 'op://GitHub.Actions/GitHub/corva-bot/PRIVATE_KEY' | ||
- name: Checkout sources | ||
uses: actions/checkout@v4.1.7 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
- name: Setup Environment | ||
uses: ./.github/actions/setup-environment | ||
with: | ||
build: "false" | ||
- name: Cache ESLint | ||
uses: actions/cache@v4.0.2 | ||
with: | ||
path: .eslintcache | ||
key: ${{ runner.os }}-eslint-${{ hashFiles('./yarn.lock') }}-${{ hashFiles('./.eslint*') }} | ||
- name: Lint | ||
run: npm run lint | ||
- name: Generate GitHub token | ||
uses: actions/create-github-app-token@v1.10.4 | ||
if: ${{ success() || failure() }} | ||
id: token | ||
with: | ||
app-id: ${{ steps.secrets.outputs.APP_ID }} | ||
private-key: ${{ steps.secrets.outputs.PRIVATE_KEY }} | ||
- name: Add PR status check | ||
uses: ouzi-dev/commit-status-updater@v2.0.2 | ||
if: ${{ success() || failure() }} | ||
with: | ||
token: ${{ steps.token.outputs.token }} | ||
name: 'Lint' | ||
status: ${{ job.status }} | ||
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
description: ${{ job.status == 'success' && 'Linted successfully' || 'Linted with errors. Check PR annotations' }} | ||
|
||
format: | ||
name: Format | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Load secrets from 1Password | ||
uses: 1password/load-secrets-action@v2.0.0 | ||
id: secrets | ||
with: | ||
export-env: false | ||
env: | ||
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_RO }} | ||
# | ||
APP_ID: 'op://GitHub.Actions/GitHub/corva-bot/APP_ID' | ||
PRIVATE_KEY: 'op://GitHub.Actions/GitHub/corva-bot/PRIVATE_KEY' | ||
- name: Checkout sources | ||
uses: actions/checkout@v4.1.7 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
- name: Setup Environment | ||
uses: ./.github/actions/setup-environment | ||
with: | ||
build: "false" | ||
- name: Format | ||
run: npm run format-check | ||
- name: Generate GitHub token | ||
uses: actions/create-github-app-token@v1.10.4 | ||
if: ${{ success() || failure() }} | ||
id: token | ||
with: | ||
app-id: ${{ steps.secrets.outputs.APP_ID }} | ||
private-key: ${{ steps.secrets.outputs.PRIVATE_KEY }} | ||
- name: Add PR status check | ||
uses: ouzi-dev/commit-status-updater@v2.0.2 | ||
if: ${{ success() || failure() }} | ||
with: | ||
token: ${{ steps.token.outputs.token }} | ||
name: 'Format' | ||
status: ${{ job.status }} | ||
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
description: ${{ job.status == 'success' && 'Code is properly formatted' || 'Code is not properly formatted. Check PR annotations' }} | ||
|
||
test: | ||
name: Unit Test | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Load secrets from 1Password | ||
uses: 1password/load-secrets-action@v2.0.0 | ||
id: secrets | ||
with: | ||
export-env: false | ||
env: | ||
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_RO }} | ||
# | ||
APP_ID: 'op://GitHub.Actions/GitHub/corva-bot/APP_ID' | ||
PRIVATE_KEY: 'op://GitHub.Actions/GitHub/corva-bot/PRIVATE_KEY' | ||
- name: Checkout sources | ||
uses: actions/checkout@v4.1.7 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
- name: Setup Environment | ||
uses: ./.github/actions/setup-environment | ||
with: | ||
build: "false" | ||
- name: Cache Jest | ||
uses: actions/cache@v4.0.2 | ||
with: | ||
path: ./node_modules/.cache/jest | ||
key: ${{ runner.os }}-jest-${{ hashFiles('./yarn.lock') }} | ||
- name: Test | ||
run: npm run test | ||
- name: Generate GitHub token | ||
uses: actions/create-github-app-token@v1.10.4 | ||
if: ${{ success() || failure() }} | ||
id: token | ||
with: | ||
app-id: ${{ steps.secrets.outputs.APP_ID }} | ||
private-key: ${{ steps.secrets.outputs.PRIVATE_KEY }} | ||
- name: Add PR status check | ||
uses: ouzi-dev/commit-status-updater@v2.0.2 | ||
if: ${{ success() || failure() }} | ||
with: | ||
token: ${{ steps.token.outputs.token }} | ||
name: 'Unit Test' | ||
status: ${{ job.status }} | ||
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
description: ${{ job.status == 'success' && 'Unit tests ran successfully' || 'Unit tests ran with errors. Check PR annotations' }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,4 +96,6 @@ Thumbs.db | |
|
||
# Ignore built ts files | ||
__tests__/runner/* | ||
lib/**/* | ||
lib/**/* | ||
|
||
.idea |
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
Oops, something went wrong.