-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Revise PR Github Action, Update testing framework and Lint Files #40
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
17d403f
fix: Revise PR Github Action and update testing framework
alexs-mparticle 6d06b04
Update package
alexs-mparticle 9905ad9
Add Dependabot
alexs-mparticle 23786eb
Update eslint globals
alexs-mparticle 5ed7b6b
Clean lint
alexs-mparticle 0a960be
Address PR Comments
alexs-mparticle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,31 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"globals": { | ||
"mParticle": true, | ||
"gtag": true, | ||
"describe": true, | ||
"Should": true, | ||
"MockHttpServer": true, | ||
"it": true, | ||
"sinon": true, | ||
"const": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"after": true, | ||
"uetq": true, | ||
"UET": true | ||
}, | ||
"extends": ["plugin:prettier/recommended", "eslint:recommended"], | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"no-prototype-builtins": "off", | ||
"no-empty": "off", | ||
"no-useless-escape": "off", | ||
"no-unexpected-multiline": "off" | ||
} | ||
} |
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,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: '/' | ||
schedule: | ||
interval: weekly | ||
day: 'sunday' | ||
target-branch: 'chore/dependabot' | ||
labels: ['dependabot', 'dependencies'] | ||
open-pull-requests-limit: 10 | ||
commit-message: | ||
prefix: 'chore' | ||
allow: | ||
- dependency-type: 'production' |
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 |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: Release Kit | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dryRun: | ||
description: 'Do a dry run to preview instead of a real release [true/false]' | ||
required: true | ||
default: 'true' | ||
|
||
jobs: | ||
# Kit release is done from master branch. | ||
confirm-public-repo-master-branch: | ||
name: 'Confirm release is run from public/master branch' | ||
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@stable | ||
|
||
build-and-test: | ||
name: Build and Test | ||
uses: mParticle/mparticle-workflows/.github/workflows/web-kit-pull-request.yml@stable | ||
needs: confirm-public-repo-master-branch | ||
|
||
create-release-branch: | ||
name: Create release branch | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-and-test | ||
- confirm-public-repo-master-branch | ||
steps: | ||
- name: Checkout development branch | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: mparticle-integrations/mparticle-javascript-integration-bingads | ||
ref: development | ||
|
||
- name: Create and push release branch | ||
run: | | ||
git checkout -b release/${{ github.run_number }} | ||
git push origin release/${{ github.run_number }} | ||
|
||
release: | ||
name: Perform Release | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-and-test | ||
- create-release-branch | ||
- confirm-public-repo-master-branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }} | ||
GIT_AUTHOR_NAME: mparticle-automation | ||
GIT_AUTHOR_EMAIL: developers@mparticle.com | ||
GIT_COMMITTER_NAME: mparticle-automation | ||
GIT_COMMITTER_EMAIL: developers@mparticle.com | ||
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout public master branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: master | ||
|
||
- name: Import GPG Key | ||
uses: crazy-max/ghaction-import-gpg@e00cb83a68c1158b29afc5217dd0582cada6d172 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Merge release branch into master branch | ||
run: | | ||
git pull origin release/${{ github.run_number }} | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Release --dry-run | ||
if: ${{ github.event.inputs.dryRun == 'true'}} | ||
run: | | ||
npx semantic-release --dry-run | ||
- name: Release | ||
if: ${{ github.event.inputs.dryRun == 'false'}} | ||
run: | | ||
npx semantic-release | ||
|
||
- name: Archive npm failure logs | ||
uses: actions/upload-artifact@v4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for remembering to make this v4! |
||
if: failure() | ||
with: | ||
name: npm-logs | ||
path: ~/.npm/_logs | ||
|
||
- name: Push automated release commits to release branch | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
git push origin HEAD:release/${{ github.run_number }} | ||
|
||
sync-repository: | ||
name: Sync repositories | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout master branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
repository: ${{ github.repository }} | ||
token: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }} | ||
ref: master | ||
|
||
- name: Merge release branch into master branch | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
git pull origin release/${{ github.run_number }} | ||
|
||
- name: Push release commits to master and development branches | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
git push origin HEAD:development | ||
git push origin HEADmaster: | ||
- name: Delete release branch | ||
if: ${{ github.event.inputs.dryRun == 'false' }} | ||
run: | | ||
git push --delete origin release/${{ github.run_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,18 @@ | ||
name: Reusable Workflows | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
web-kit-pull-request: | ||
name: Run Web Kit PR Workflow | ||
uses: mParticle/mparticle-workflows/.github/workflows/web-kit-pull-request.yml@stable | ||
pr-branch-check-name: | ||
name: Check PR for semantic branch name | ||
uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-check-name.yml@stable | ||
pr-title-check: | ||
name: Check PR for semantic title | ||
uses: mParticle/mparticle-workflows/.github/workflows/pr-title-check.yml@stable | ||
pr-branch-target-gitflow: | ||
name: Check PR for semantic target branch | ||
uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-target-gitflow.yml@stable |
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 @@ | ||
v18.15.0 |
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,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"tabWidth": 4 | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed you didn't include dependabot files in a previous CI/CD update. Including it will just result in a ton of spam from testing dependencies. Decisio is yours, but my thoughts are to remove and reconsider when we have a new forwarder ecosystem architecture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an older repo, we have a lot of backlogged dependabot updates. My thought was to include the dependabot yml from Web SDK that isolates the main/master branch, limits updates to production only and runs once a week. This way we can reduce the deluge of PRrs and bring things in line until we can come up with a better solution.