-
-
Notifications
You must be signed in to change notification settings - Fork 47
update #107
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
update #107
Changes from all commits
3bf7b46
92830a6
4a6c980
6fb672e
eabe990
67097e7
2484e76
00a525a
5ae32fd
bd1d5ec
73297d6
e290ff7
0c0b025
6d41a15
e22a3cb
451e83e
2f43de8
57bcb96
b5370ae
a90c547
83a187f
e973974
6354523
ea7ee36
58bca22
6185135
c55d7a8
07d49fa
5a95310
08085a8
45b8c77
4ef942a
a4de4df
48aefd3
12d6029
f5d4108
43bb02d
318abc1
f576af6
589a3b9
1cb8830
4c7f06f
3077577
7b65092
a0f29d4
26cb5c4
860da62
bc9bada
d58b8dd
d4977f8
144a845
afa0e8b
789eb71
d3d164b
bb6b5fc
d5b819b
7959611
032b6c2
2501aa9
4ac635e
e9a318b
3a3c8db
f1e649d
4a3d1ee
aaad753
9ef6fa2
01f89c0
4f27e71
c6bdb49
46d00c2
a6227c9
220b869
5f7f846
2ef92c9
65c8288
110850c
1f41534
6f1ccc8
5477027
ec7f8d8
0980063
22f6c5b
6c79b83
b333daa
379afc2
0db5d2e
40b9289
35bb8bc
4baf271
718fce8
caf0710
266a4ab
9fb5881
76f650d
f30ae72
eb08131
3b026b5
c03c658
cc995d8
90feb9a
101e019
5cfc1c1
ee2909a
e45ebc7
da7e6c2
3202303
2df957b
ac91abc
d227c6d
7419926
8d90c95
fc8ccc9
de6512a
4c9536a
3c78ec2
d92a36a
a2b5d8d
39ec4c2
879c884
40156f3
fec6450
5dcf4e2
44589f8
65ab5f3
e7f5e11
88eb0d3
02fde27
d2d3801
7a86ef9
822c5e1
15da8f9
ec87509
383b314
4839fba
bf0cbfe
f96a846
7c89bd3
ca37ae1
a4d902e
bc2cab1
4e2d780
47224bb
2e1b202
c46187d
f5e63bb
e5e03e4
7079c10
8cffca8
e477c52
e16d974
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: "CodeQL Analysis" | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: {} | ||
| schedule: | ||
| - cron: '0 4 * * 0' # weekly | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (CodeQL) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium
score is 5: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v2 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium
score is 5: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
| with: | ||
| languages: python | ||
|
|
||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v2 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium
score is 5: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
|
|
||
| - name: Perform CodeQL analysis | ||
| uses: github/codeql-action/analyze@v2 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium
score is 5: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # This workflow uses actions that are not certified by GitHub. They are provided | ||
| # by a third-party and are governed by separate terms of service, privacy | ||
| # policy, and support documentation. | ||
|
|
||
| name: Scorecard supply-chain security | ||
| on: | ||
| # For Branch-Protection check. Only the default branch is supported. See | ||
| # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection | ||
| branch_protection_rule: | ||
| # To guarantee Maintained check is occasionally updated. See | ||
| # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained | ||
| schedule: | ||
| - cron: '37 5 * * 2' | ||
| push: | ||
| branches: [ "main" ] | ||
|
|
||
| # Declare default permissions as read only. | ||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| analysis: | ||
| name: Scorecard analysis | ||
| runs-on: ubuntu-latest | ||
| # `publish_results: true` only works when run from the default branch. conditional can be removed if disabled. | ||
| if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request' | ||
| permissions: | ||
| # Needed to upload the results to code-scanning dashboard. | ||
| security-events: write | ||
| # Needed to publish results and get a badge (see publish_results below). | ||
| id-token: write | ||
| # Uncomment the permissions below if installing in a private repository. | ||
| # contents: read | ||
| # actions: read | ||
|
|
||
| steps: | ||
| - name: "Checkout code" | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: "Run analysis" | ||
| uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 | ||
| with: | ||
| results_file: results.sarif | ||
| results_format: sarif | ||
| # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: | ||
| # - you want to enable the Branch-Protection check on a *public* repository, or | ||
| # - you are installing Scorecard on a *private* repository | ||
| # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. | ||
| # repo_token: ${{ secrets.SCORECARD_TOKEN }} | ||
|
|
||
| # Public repositories: | ||
| # - Publish results to OpenSSF REST API for easy access by consumers | ||
| # - Allows the repository to include the Scorecard badge. | ||
| # - See https://github.com/ossf/scorecard-action#publishing-results. | ||
| # For private repositories: | ||
| # - `publish_results` will always be set to `false`, regardless | ||
| # of the value entered here. | ||
| publish_results: true | ||
|
|
||
| # (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore | ||
| # file_mode: git | ||
|
|
||
| # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF | ||
| # format to the repository Actions tab. | ||
| - name: "Upload artifact" | ||
| uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
| with: | ||
| name: SARIF file | ||
| path: results.sarif | ||
| retention-days: 5 | ||
|
|
||
| # Upload the results to GitHub's code scanning dashboard (optional). | ||
| # Commenting out will disable upload of results to your repo's Code Scanning dashboard | ||
| - name: "Upload to code-scanning" | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| name: Test Suite | ||
|
|
||
|
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main, develop] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test Python ${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: test | ||
| POSTGRES_DB: caracal_test | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 5432:5432 | ||
|
|
||
| redis: | ||
| image: redis:7 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 6379:6379 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium test
score is 1: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium test
score is 1: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
|
|
||
| - name: Install uv | ||
| run: | | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium test
score is 1: downloadThenRun not pinned by hash
Click Remediation section below to solve this issue |
||
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv pip install --system -e ".[dev]" | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| pytest -m unit \ | ||
| --cov=caracal \ | ||
| --cov-report=xml \ | ||
| --cov-report=term \ | ||
| --junitxml=junit-unit.xml | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }} | ||
|
|
||
| - name: Run integration tests | ||
| run: | | ||
| pytest -m integration \ | ||
| --cov=caracal \ | ||
| --cov-append \ | ||
| --cov-report=xml \ | ||
| --cov-report=term \ | ||
| --junitxml=junit-integration.xml | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:test@localhost:5432/caracal_test | ||
| REDIS_URL: redis://localhost:6379 | ||
| PYTHONPATH: ${{ github.workspace }} | ||
|
|
||
| - name: Run security tests | ||
| run: | | ||
| pytest tests/security/ \ | ||
| --cov=caracal \ | ||
| --cov-append \ | ||
| --cov-report=xml \ | ||
| --cov-report=term \ | ||
| --junitxml=junit-security.xml | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:test@localhost:5432/caracal_test | ||
| REDIS_URL: redis://localhost:6379 | ||
| PYTHONPATH: ${{ github.workspace }} | ||
|
|
||
| - name: Run e2e tests | ||
| run: | | ||
| pytest -m e2e \ | ||
| --cov=caracal \ | ||
| --cov-append \ | ||
| --cov-report=xml \ | ||
| --cov-report=term \ | ||
| --junitxml=junit-e2e.xml | ||
| env: | ||
| DATABASE_URL: postgresql://postgres:test@localhost:5432/caracal_test | ||
| REDIS_URL: redis://localhost:6379 | ||
| PYTHONPATH: ${{ github.workspace }} | ||
|
|
||
| - name: Display coverage report | ||
| if: always() | ||
| run: | | ||
| echo "=== Coverage Report ===" | ||
| coverage report | ||
| echo "" | ||
| echo "Coverage report generated (no threshold enforcement)" | ||
|
|
||
| - name: Generate HTML coverage report | ||
| if: always() | ||
| run: | | ||
| coverage html | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| if: matrix.python-version == '3.11' | ||
| uses: codecov/codecov-action@v4 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium test
score is 1: third-party GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
| with: | ||
| file: ./coverage.xml | ||
| flags: unittests | ||
| name: codecov-umbrella | ||
| fail_ci_if_error: false | ||
|
|
||
| - name: Upload HTML coverage report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium test
score is 1: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
| with: | ||
| name: coverage-report-${{ matrix.python-version }} | ||
| path: htmlcov/ | ||
| retention-days: 30 | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
Check warningCode scanning / Scorecard Pinned-Dependencies Medium test
score is 1: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io Click Remediation section below for further remediation help |
||
| with: | ||
| name: test-results-${{ matrix.python-version }} | ||
| path: | | ||
| junit-*.xml | ||
| retention-days: 30 | ||
|
|
||
| test-summary: | ||
| name: Test Summary | ||
| runs-on: ubuntu-latest | ||
| needs: test | ||
| if: always() | ||
|
|
||
| steps: | ||
| - name: Check test results | ||
| run: | | ||
| if [ "${{ needs.test.result }}" == "failure" ]; then | ||
| echo "Tests failed" | ||
| exit 1 | ||
| elif [ "${{ needs.test.result }}" == "cancelled" ]; then | ||
| echo "Tests were cancelled" | ||
| exit 1 | ||
| else | ||
| echo "All tests passed" | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.