-
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.
- Loading branch information
Showing
89 changed files
with
13,591 additions
and
23 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,4 @@ | ||
node_modules/ | ||
dist/ | ||
bundle/ | ||
* |
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,3 @@ | ||
* @nRFCloud/backend | ||
/.github/ @nRFCloud/devops @nRFCloud/backend | ||
/**/aws/ @nRFCloud/devops @nRFCloud/backend |
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,10 @@ | ||
Script changes: | ||
- packages/scripts/**/* | ||
|
||
Infrastructure changes: | ||
- packages/deployment/**/* | ||
- packages/*/src/aws/**/* | ||
|
||
Implementation changes: | ||
- packages/*/src/**/* | ||
- !packages/*/src/aws/**/* |
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,41 @@ | ||
name: Lint Code | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
lint: | ||
name: Lint Back-end code | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.2.0 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Prepare | ||
run: pnpm i | ||
- name: Lint Back-end | ||
run: pnpm lint |
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,34 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.2.0 | ||
fetch-depth: 0 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Prepare | ||
run: pnpm i --frozen-lockfile | ||
- name: Release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: pnpm release |
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,56 @@ | ||
name: Slack notification | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize, ready_for_review] | ||
|
||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
|
||
jobs: | ||
slackNotification: | ||
name: Send Slack notifications | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- name: New PR | ||
if: github.event.action == 'opened' && github.event.pull_request.draft == false | ||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 #v2.2.0 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
MSG_MINIMAL: true | ||
SLACK_TITLE: PR Created | ||
SLACK_LINK_NAMES: true | ||
SLACK_FOOTER: '' | ||
SLACK_MESSAGE: | | ||
@here | ||
nornir | ||
${{ github.event.pull_request.title }} | ||
https://github.com/nRFCloud/nornir/pull/${{ github.event.number }} | ||
- name: PR Ready for Review | ||
if: github.event.action == 'ready_for_review' && github.event.pull_request.draft == false | ||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 #v2.2.0 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
MSG_MINIMAL: true | ||
SLACK_TITLE: PR Ready for Review | ||
SLACK_LINK_NAMES: true | ||
SLACK_FOOTER: '' | ||
SLACK_MESSAGE: | | ||
@here | ||
nornir | ||
${{ github.event.pull_request.title }} | ||
https://github.com/nRFCloud/nornir/pull/${{ github.event.number }} | ||
- name: Updated PR | ||
if: github.event.action == 'synchronize' && github.event.pull_request.draft == false | ||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 #v2.2.0 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
MSG_MINIMAL: true | ||
SLACK_TITLE: PR Updated | ||
SLACK_FOOTER: '' | ||
SLACK_MESSAGE: | | ||
nornir | ||
${{ github.event.pull_request.title }} | ||
https://github.com/nRFCloud/nornir/pull/${{ github.event.number }} |
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,17 @@ | ||
name: Block merging PRs with 'no-merge' label | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize, opened, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
no-merge: | ||
if: ${{ contains(github.event.*.labels.*.name, 'no-merge') }} | ||
name: Block merging PRs with no-merge label | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fail due to existing label | ||
run: | | ||
echo "Pull request is labeled as 'no-merge'." | ||
echo "This workflow fails so that the pull request cannot be merged." | ||
exit 1 |
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,50 @@ | ||
name: Unit Tests | ||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | ||
cancel-in-progress: true | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
jobs: | ||
unit-tests: | ||
name: Run unit tests for this service | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.2.0 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'pnpm' | ||
registry-url: 'https://registry.npmjs.org' | ||
- uses: satackey/[email protected] | ||
# Ignore the failure of a step and avoid terminating the job. | ||
continue-on-error: true | ||
- name: Prepare | ||
run: pnpm i | ||
- name: Build | ||
run: pnpm build | ||
- name: Run unit tests | ||
run: pnpm test | ||
- name: Publish coverage | ||
if: always() | ||
uses: ArtiomTr/jest-coverage-report-action@v2 | ||
with: | ||
coverage-file: reports/report.json | ||
base-coverage-file: reports/report.json | ||
- name: Publish report | ||
if: always() | ||
uses: dorny/test-reporter@v1 | ||
with: | ||
name: Unit Tests | ||
path: reports/junit.xml | ||
reporter: jest-junit | ||
fail-on-error: false |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm commitlint --edit "$1" |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm lint |
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,32 @@ | ||
{ | ||
"branches": [ | ||
{ | ||
"name": "main", | ||
"channel": "dev", | ||
"prerelease": "dev" | ||
}, | ||
"release" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
["@semantic-release/npm", { | ||
"tarballDir": "zipped" | ||
}], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"successComment": false, | ||
"addReleases": "bottom", | ||
"failTitle": false, | ||
"assets": [ | ||
{ | ||
"path": "zipped/*.tgz", | ||
"label": "Download" | ||
} | ||
] | ||
} | ||
] | ||
] | ||
} |
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,7 @@ | ||
dependencyTypes: | ||
- dev | ||
- overrides | ||
- peer | ||
- pnpmOverrides | ||
- prod | ||
- resolutions |
Oops, something went wrong.