-
Notifications
You must be signed in to change notification settings - Fork 121
Coverage action #856
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
Closed
Coverage action #856
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
778b255
file name test
aGuttman ae58964
dir name test
aGuttman d586add
Create test-default-action.yml
aGuttman beed818
test coverage badge
aGuttman fee792e
Update test-default-action.yml
aGuttman 6c13ec5
Update .coverage
aGuttman de28ce7
Update test-default-action.yml
aGuttman 4732c8a
Update test-default-action.yml
aGuttman 6e49c6a
Create .coveragerc
aGuttman 29d13c8
Update .coveragerc
aGuttman 0cd8eaf
Update .coverage
aGuttman 28b125e
Update test-default-action.yml
aGuttman d870820
Update test-default-action.yml
aGuttman 5cc18f8
Updated coverage.svg
github-actions[bot] 1e31ec5
Update README.md
aGuttman d78dcc4
Update test-default-action.yml
aGuttman 8010e54
Update .coverage
aGuttman a374d38
Updated coverage.svg
github-actions[bot] 1ab4520
Update test-default-action.yml
aGuttman 4125535
Merge branch 'coverage_action' of https://github.com/aGuttman/e-missi…
aGuttman e00efa1
Updated coverage.svg
github-actions[bot] 3c20586
revert file names
aGuttman bfd4e4a
revert file names
aGuttman 536fa8d
Update .gitignore
aGuttman e882944
Merge branch 'e-mission:master' into coverage_action
aGuttman a9a279d
Update coverage-badge-and-comment.yml
aGuttman 76345e7
Create coverage.yml
aGuttman 0866d6a
add coverage action to gis branch, set verbose option comment action
aGuttman 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,5 @@ | ||
| [run] | ||
| relative_files = True | ||
| omit = | ||
| *tests* | ||
| *bottle.py |
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,109 @@ | ||
| # This is a basic workflow to help you get started with Actions | ||
|
|
||
| name: Coverage | ||
|
|
||
| # Controls when the action will run. Triggers the workflow on push or pull request | ||
| # events but only for the master branch | ||
| on: | ||
| push: | ||
| branches: [ master, gis-based-mode-detection ] | ||
| pull_request: | ||
| branches: [ master, gis-based-mode-detection ] | ||
|
|
||
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
| jobs: | ||
| # This workflow contains a single job called "build" | ||
| build: | ||
| # The type of runner that the job will run on | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # 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@v2 | ||
|
|
||
| - name: Install and start MongoDB | ||
| uses: supercharge/[email protected] | ||
| with: | ||
| mongodb-version: 4.4.0 | ||
|
|
||
| - name: Check existing version of miniconda | ||
| shell: bash -l {0} | ||
| run: conda info -a | ||
|
|
||
| - name: Install miniconda | ||
| shell: bash -l {0} | ||
| run: | | ||
| source setup/setup_conda.sh Linux-x86_64 | ||
|
|
||
| - name: Check whether the CI environment variable is set | ||
| shell: bash -l {0} | ||
| run: | | ||
| source setup/activate_conda.sh | ||
| echo $CI | ||
|
|
||
| - name: Setup the emission environment for testing | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda --version | ||
| which conda | ||
| source setup/activate_conda.sh | ||
| conda --version | ||
| source setup/setup.sh | ||
| conda env list | ||
|
|
||
| - name: Switch to emission, install/run Coverage | ||
| shell: bash -l {0} | ||
| run: | | ||
| conda env list | ||
| source setup/activate.sh | ||
| conda env list | ||
| pip install coverage | ||
| coverage --version | ||
| export PYTHONPATH=. | ||
| coverage run -m unittest discover -s emission/tests -p Test*; | ||
| coverage report | ||
|
|
||
| - name: Coverage Badge | ||
| uses: tj-actions/[email protected] | ||
|
|
||
| - name: Verify Changed files | ||
| uses: tj-actions/verify-changed-files@v9 | ||
| id: changed_files | ||
| with: | ||
| files: coverage.svg | ||
|
|
||
| - name: Commit files | ||
| if: steps.changed_files.outputs.files_changed == 'true' | ||
| run: | | ||
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
| git add coverage.svg | ||
| git commit -m "Updated coverage.svg" | ||
|
|
||
| - name: Push changes | ||
| if: steps.changed_files.outputs.files_changed == 'true' | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| github_token: ${{ secrets.github_token }} | ||
| branch: ${{ github.head_ref }} | ||
|
|
||
| - name: Coverage comment | ||
| id: coverage_comment | ||
| uses: ewjoachim/python-coverage-comment-action@v2 | ||
| with: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| VERBOSE: true | ||
|
|
||
| - name: Store Pull Request comment to be posted | ||
| uses: actions/upload-artifact@v2 | ||
| if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | ||
| with: | ||
| # If you use a different name, update COMMENT_ARTIFACT_NAME accordingly | ||
| name: python-coverage-comment-action | ||
| # If you use a different name, update COMMENT_FILENAME accordingly | ||
| path: python-coverage-comment-action.txt | ||
|
|
||
| - name: Teardown the test environment | ||
| shell: bash -l {0} | ||
| run: source setup/teardown_tests.sh | ||
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,25 @@ | ||
| name: Post coverage comment | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Coverage"] | ||
| types: | ||
| - completed | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Run tests & display coverage | ||
| runs-on: ubuntu-latest | ||
| if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||
| steps: | ||
| # DO NOT run actions/checkout@v2 here, for securitity reasons | ||
| # For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
| - name: Post comment | ||
| uses: ewjoachim/python-coverage-comment-action@v2 | ||
| with: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }} | ||
| VERBOSE: true | ||
| # Update those if you changed the default values: | ||
| # COMMENT_ARTIFACT_NAME: python-coverage-comment-action | ||
| # COMMENT_FILENAME: python-coverage-comment-action.txt |
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 |
|---|---|---|
|
|
@@ -19,3 +19,5 @@ conf/**/*.json | |
| *.ipynb_checkpoints* | ||
|
|
||
| *.secret | ||
|
|
||
| .coverage | ||
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.