-
Notifications
You must be signed in to change notification settings - Fork 62
Actions for build, run test cases and sonar analysis on a PR #87
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
Open
yashashkumar
wants to merge
5
commits into
Sunbird-Knowlg:release-5.2.1
Choose a base branch
from
yashashkumar:actions
base: release-5.2.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
834abbf
Added workflow for build, run test cases and sonar analysis on a PR. …
vinodbhorge dd57bfc
Updated the Readme file.
vinodbhorge c004476
Merge pull request #1 from vinodbhorge/git-action
yashashkumar b407d09
Apply suggestions from code review
yashashkumar 40138db
Update pull-request.yml
yashashkumar 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 was deleted.
Oops, something went wrong.
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,53 @@ | ||
| // this plugin is used to make all rules default to warnings | ||
| equire('eslint-plugin-only-warn'); | ||
|
|
||
| module.exports = { | ||
| extends: 'standard', | ||
| plugins: ['only-warn'], // makes all rules default to warnings | ||
| ignorePatterns: ['gulpfile.js', 'webpack.config.js', 'app/bower_components/**'], | ||
| globals: { | ||
| org: true, | ||
| CryptoJS: true, | ||
| _: true, | ||
| $: true, | ||
| angular: true, | ||
| ecEditor: true, | ||
| EkTelemetry: true, | ||
| EkstepEditor: true, | ||
| EkstepEditorAPI: true, | ||
| Class: true, | ||
| UUID: true, | ||
| WebFontConfig: true, | ||
| TextWYSIWYG: true, | ||
| ManifestGenerator: true, | ||
| WebFont: true, | ||
| fabric: true, | ||
| ServiceConstants: true, | ||
| async: true, | ||
| Fingerprint2: true, | ||
| describe: true, | ||
| jasmine: true, | ||
| afterAll: true, | ||
| beforeAll: true, | ||
| it: true, | ||
| spyOn: true, | ||
| expect: true, | ||
| xit: true, | ||
| EventBus: true, | ||
| beforeEach: true, | ||
| canvas: true, | ||
| Plugin: true, | ||
| createjs: true, | ||
| p: true, | ||
| basePlugin: true, | ||
| Mousetrap: true, | ||
| afterEach: true, | ||
| location: true, | ||
| X2JS: true | ||
| }, | ||
| rules: { | ||
| indent: [2, 'tab'], | ||
| 'no-tabs': 0, | ||
| 'no-throw-literal': 'error', | ||
| } | ||
| } | ||
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,101 @@ | ||
| name: Build and Test on Pull Request | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
|
|
||
| env: | ||
| CONTENT_PLUGIN_VERSION: ${{ vars.CONTENT_PLUGIN_VERSION || 'release-8.0.0' }} | ||
|
|
||
| jobs: | ||
| build-test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| version_number: ${{ github.ref_name }} | ||
| build_number: ${{ github.run_number }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Node.js 10 | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 10.24.1 | ||
|
|
||
| - name: Cache node modules | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: node_modules | ||
| key: ${{ runner.os }}-node-${{ hashFiles('package.json') }} | ||
|
|
||
| - name: Clone plugins (from fork) | ||
| run: | | ||
| git clone --branch ${{ env.CONTENT_PLUGIN_VERSION }} https://github.com/vinodbhorge/sunbird-content-plugins.git plugins | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| which bower || sudo npm install -g [email protected] | ||
| which grunt || sudo npm install -g [email protected] | ||
| which gulp || sudo npm install -g [email protected] | ||
| sudo apt-get install build-essential libpng-dev | ||
|
|
||
| - name: Bower cache clean | ||
| working-directory: app | ||
| run: bower cache clean --allow-root | ||
|
|
||
| - name: Bower install | ||
| working-directory: app | ||
| run: bower install --force --allow-root | ||
|
|
||
| - name: Install global npm packages | ||
| run: npm install --legacy-peer-deps | ||
|
|
||
| - name: Gulp packageCorePlugins | ||
| run: gulp packageCorePlugins | ||
|
|
||
| - name: Plugin build | ||
| run: npm run plugin-build | ||
|
|
||
| - name: Run build | ||
| run: npm run build | ||
|
|
||
| - name: Test | ||
| run: npm run test | ||
| continue-on-error: true | ||
|
|
||
| - name: Set up Node.js 14 (for Sonar) | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 14 | ||
|
|
||
| - name: Install SonarQube scanner | ||
| run: npm install -g sonarqube-scanner | ||
|
|
||
| - name: Run SonarQube scanner | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| run: sonar-scanner | ||
|
|
||
| lint: | ||
| needs: build-test | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Node.js 18 | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Cache node modules | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: node_modules | ||
| key: ${{ runner.os }}-node-${{ hashFiles('package.json') }} | ||
|
|
||
| - name: Run Lint | ||
| run: npm run lint |
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
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.
Uh oh!
There was an error while loading. Please reload this page.