-
Notifications
You must be signed in to change notification settings - Fork 0
[MOB-11390] add-git-action-to-run-tests-in-ci #34
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
Closed
lposen
wants to merge
31
commits into
MOB-11405-add-tests-for-withandroidpushnotifications
from
MOB-11390-add-git-action-to-run-tests-in-ci
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
437a52d
chore: add GitHub Actions setup and CI workflow for Node.js project, β¦
lposen 35f3f5d
chore: update pull request template to use placeholder text for screeβ¦
lposen 371b359
chore: refine pull request template by adding a space for clarity in β¦
lposen eed96e9
docs: add code coverage badge to README for improved visibility of teβ¦
lposen 43aff7d
chore: add CI workflow for library build, type checking, linting, andβ¦
lposen 5bc10b0
docs: update code coverage badge in README to reflect Code Climate inβ¦
lposen 40d5826
docs: update coverage badge in README to a more descriptive format
lposen bf073d1
docs: add license badge and Code Climate coverage badge to README forβ¦
lposen fb9abda
ci: add coverage badge generation step in workflow and update README β¦
lposen 5b128ad
ci: add output for coverage step in workflow to improve CI reporting
lposen b5e68f0
ci: reorder coverage badge generation step in workflow for improved cβ¦
lposen e0b534a
ci: fix output redirection syntax in coverage badge generation step fβ¦
lposen 414f514
ci: integrate QLTY coverage reporting in workflow and remove Codecov β¦
lposen 5344e7a
Merge branch 'main' into MOB-11390-add-git-action-to-run-tests-in-ci
lposen c4d8121
ci: update GitHub Actions checkout action to v4 and fix token syntax β¦
lposen e6b7099
Merge branch 'MOB-11390-add-git-action-to-run-tests-in-ci' of https:/β¦
lposen b221973
ci: update GitHub Actions to use checkout and setup-node actions at vβ¦
lposen 56bf046
ci: add permissions to GitHub Actions workflows for improved functionβ¦
lposen 3e71ad0
docs: update README and pull request template formatting, as per qlty
lposen 830e1b8
fix: add missing newlines at the end of action.yml and google-serviceβ¦
lposen db2f438
docs: update README to replace Code Climate badge with QLTY badges foβ¦
lposen 2cbc410
ci: rename workflows for clarity and remove coverage badge workflow
lposen 89a10a8
Merge branch 'MOB-11405-add-tests-for-withandroidpushnotifications' iβ¦
lposen f94d42e
ci: add GitHub Actions workflow for automated build and commit process
lposen 3d28a4b
ci: add linting and type-checking workflow to GitHub Actions
lposen c120de9
ci: force add build directory to ensure all files are committed in Giβ¦
lposen da95614
ci: update GitHub Actions workflow to push build results to the correβ¦
lposen 6c39051
ci: enhance GitHub Actions workflow to handle commits based on event β¦
lposen dbf979c
chore: update build files [skip ci]
invalid-email-address e0b23cc
ci: refactor GitHub Actions workflow by commenting out existing stepsβ¦
lposen a50be99
ci: update GitHub Actions workflow to include build step and rename lβ¦
lposen 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 hidden or 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,27 @@ | ||
| name: Setup | ||
| description: Setup Node.js and install dependencies | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
|
|
||
| - name: Cache dependencies | ||
| id: yarn-cache | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| **/node_modules | ||
| .yarn/install-state.gz | ||
| key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | ||
| ${{ runner.os }}-yarn- | ||
|
|
||
| - name: Install dependencies | ||
| if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
| run: yarn install --immutable | ||
| shell: bash |
This file contains hidden or 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 hidden or 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: Build and Commit | ||
|
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. 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. |
||
|
|
||
| # on: | ||
| # push: | ||
| # branches: | ||
| # - main | ||
| # pull_request: | ||
| # branches: | ||
| # - main | ||
| # workflow_dispatch: | ||
|
|
||
| # permissions: | ||
| # contents: write # Required for committing changes | ||
|
|
||
| # jobs: | ||
| # build-and-commit: | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # - name: Checkout | ||
| # uses: actions/checkout@v4 | ||
| # with: | ||
| # fetch-depth: 0 # Fetch all history for proper versioning | ||
| # ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| # - name: Setup Node.js | ||
| # uses: actions/setup-node@v4 | ||
| # with: | ||
| # node-version: '20' | ||
| # cache: 'yarn' | ||
|
|
||
| # - name: Install dependencies | ||
| # run: yarn install | ||
|
|
||
| # - name: Build package | ||
| # run: yarn prepare | ||
|
|
||
| # - name: Configure Git | ||
| # run: | | ||
| # git config --global user.name 'GitHub Actions' | ||
| # git config --global user.email 'github-actions@github.com' | ||
|
|
||
| # - name: Commit build results | ||
| # run: | | ||
| # git add build/ -f | ||
| # if git diff --quiet && git diff --staged --quiet; then | ||
| # echo "No changes to commit" | ||
| # exit 0 | ||
| # fi | ||
|
|
||
| # if [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
| # git commit -m "chore: update build files [skip ci]" | ||
| # git push origin HEAD:refs/heads/${{ github.head_ref }} | ||
| # else | ||
| # git commit -m "chore: update build files [skip ci]" | ||
| # git push origin HEAD:refs/heads/${{ github.ref_name }} | ||
| # fi | ||
This file contains hidden or 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,74 @@ | ||
| name: Build and Lint | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| merge_group: | ||
| types: | ||
| - checks_requested | ||
|
|
||
| permissions: | ||
| contents: read # Required for checking out code | ||
| checks: write # Required for updating check status | ||
| security-events: write # Required for security scanning | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Dependency Review | ||
| uses: actions/dependency-review-action@v4 | ||
| with: | ||
| fail-on-severity: high | ||
|
|
||
| type-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Type check | ||
| run: yarn tsc --noEmit | ||
| build-library: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Build package | ||
| run: yarn prepare | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Lint files | ||
| run: yarn lint | ||
|
|
||
| misspell: | ||
| name: runner / misspell | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code. | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: misspell | ||
| uses: reviewdog/action-misspell@9daa94af4357dddb6fd3775de806bc0a8e98d3e4 # v1.26.3 | ||
| with: | ||
| github_token: ${{ secrets.github_token }} | ||
| locale: 'US' |
This file contains hidden or 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: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| merge_group: | ||
| types: | ||
| - checks_requested | ||
|
|
||
| permissions: | ||
| contents: read # Required for checking out code | ||
| checks: write # Required for updating check status | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Run unit tests with coverage | ||
| run: yarn test:coverage --maxWorkers=2 | ||
|
|
||
| - name: Check coverage thresholds | ||
| run: | | ||
| COVERAGE_THRESHOLD=80 | ||
| COVERAGE=$(cat coverage/coverage-summary.json | jq -r '.total.lines.pct') | ||
| if (( $(echo "$COVERAGE < $COVERAGE_THRESHOLD" | bc -l) )); then | ||
| echo "Coverage ($COVERAGE%) is below threshold ($COVERAGE_THRESHOLD%)" | ||
| exit 1 | ||
| fi | ||
| echo "Coverage ($COVERAGE%) is above threshold ($COVERAGE_THRESHOLD%)" | ||
|
|
||
| - name: Upload coverage to QLTY | ||
| uses: qltysh/qlty-action/coverage@v1 | ||
| with: | ||
| token: ${{ secrets.QLTY_COVERAGE_TOKEN }} | ||
| files: coverage/lcov.info | ||
| - name: Add test coverage comment | ||
| id: coverageComment | ||
| uses: MishaKav/jest-coverage-comment@main | ||
| with: | ||
| hide-comment: false | ||
| coverage-summary-path: ./coverage/coverage-summary.json |
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.
workflow is empty [actionlint:syntax-check]