-
Notifications
You must be signed in to change notification settings - Fork 11
SECURITY-49: Add GHA workflows #184
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fe85977
add gha files
Xiangs18 27ad68e
switch to docker compose
Xiangs18 f6e414c
update deps that containers can run
Xiangs18 39f99a1
pin specific werkzeug version
Xiangs18 64926da
display coverge on the terminal
Xiangs18 e83cabe
covert to pytest
Xiangs18 7b9fb93
add cov args
Xiangs18 a3dd338
add cov-omit arg and remove comments
Xiangs18 2d97eae
add .coveragerc file
Xiangs18 0a5316b
add cov-branch
Xiangs18 b9caf46
add more files to ignore
Xiangs18 8800086
update .coveragerc file
Xiangs18 92225f1
clean up files
Xiangs18 dc61123
remove redudant workflows and coverage file omission
Xiangs18 b6984f3
add .coveragerc and exclude test files from coverage
Xiangs18 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,3 @@ | ||
| [coverage:report] | ||
| omit = | ||
| */test_* |
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,52 @@ | ||
| name: "Code scanning - action" | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| schedule: | ||
| - cron: '0 19 * * 0' | ||
|
|
||
| jobs: | ||
| CodeQL-Build: | ||
|
|
||
| # CodeQL runs on ubuntu-latest and windows-latest | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # We must fetch at least the immediate parents so that if this is | ||
| # a pull request then we can checkout the head. | ||
| fetch-depth: 2 | ||
|
|
||
| # If this run was triggered by a pull request event, then checkout | ||
| # the head of the pull request instead of the merge commit. | ||
| - run: git checkout HEAD^2 | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| # Override language selection by uncommenting this and choosing your languages | ||
| # with: | ||
| # languages: go, javascript, csharp, python, cpp, java | ||
|
|
||
| # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
| # If this step fails, then you should remove it and run the build manually (see below) | ||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v3 | ||
|
|
||
| # ℹ️ Command-line programs to run using the OS shell. | ||
| # 📚 https://git.io/JvXDl | ||
|
|
||
| # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
| # and modify them (or add more) to build your code if your project | ||
| # uses a compiled language | ||
|
|
||
| #- run: | | ||
| # make bootstrap | ||
| # make release | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 |
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,11 @@ | ||
| --- | ||
| name: Manual Build & Push | ||
| on: | ||
| workflow_dispatch: | ||
| jobs: | ||
| build-push: | ||
| uses: kbase/.github/.github/workflows/reusable_build-push.yml@main | ||
| with: | ||
| name: '${{ github.event.repository.name }}-develop' | ||
| tags: br-${{ github.ref_name }} | ||
| secrets: inherit | ||
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
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 |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| Flask==2.1.3 | ||
| itsdangerous==2.1.2 | ||
| greenlet==1.1.2 | ||
| greenlet==3.1.1 | ||
| gunicorn==20.1.0 | ||
| gevent==21.12.0 | ||
| gevent==24.11.1 | ||
| simplejson==3.17.6 | ||
| python-dotenv==0.20.0 | ||
| requests==2.28.1 | ||
| jsonpointer==2.3 | ||
| jsonschema==4.8.0 | ||
| jsonschema[format]==4.8.0 | ||
| pyyaml==6.0 | ||
| pyyaml==6.0.1 | ||
| rfc3987==1.3.8 | ||
| jinja2==3.1.2 | ||
| werkzeug==2.0.3 |
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 |
|---|---|---|
|
|
@@ -10,20 +10,18 @@ echo "> black" | |
| black . | ||
| echo "> flake8" | ||
| flake8 --max-complexity 20 /app | ||
| echo "> mypy" | ||
| mypy --ignore-missing-imports /app | ||
| # echo "> mypy" | ||
| # mypy --ignore-missing-imports /app | ||
| echo "> bandit" | ||
| bandit -r -c .bandit.yaml /app | ||
|
|
||
| # start server, using the specs in /spec/repo | ||
| sh /app/scripts/start_server.sh & | ||
| coverage erase | ||
|
|
||
| # spec validation | ||
| python -m spec.validate | ||
| # wait for the RE service to be up so integration tests can pass | ||
| python -m relation_engine_server.utils.wait_for api | ||
| # run importer/, relation_engine_server/, and spec/ tests | ||
| coverage run --branch -m pytest -vv | ||
| # RE client tests - seems like these tests were already run in the line above, why run them again? | ||
| PYTHONPATH=client_src python -m pytest client_src/test | ||
| coverage html --omit=*/test_* | ||
|
|
||
| # run importer/, relation_engine_server/, spec/, scripts/, and client_src/ tests | ||
| pytest -vv --cov=. --cov-branch --cov-report=term --cov-report=xml | ||
|
Member
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. Do you not need to exclude the test directory?
Contributor
Author
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. Oops, done. |
||
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium