Skip to content

Commit

Permalink
Fix the docker image upload (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger authored Jan 13, 2025
1 parent cee0b50 commit 815324b
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 7 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/_docker_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ name: Build and push Docker image

on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -37,8 +42,8 @@ jobs:
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
Expand All @@ -52,7 +57,7 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
btschwertfeger/kraken-infinity-grid
${{ env.IMAGE_NAME }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker images
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
## Run the unit and integration tests
##
Test:
needs: [Build]
needs: [Pre-Commit]
uses: ./.github/workflows/_test.yaml
strategy:
fail-fast: true
Expand All @@ -91,8 +91,7 @@ jobs:
success()
&& github.actor == 'btschwertfeger'
&& github.event_name != 'schedule'
needs:
- Test
needs: [Pre-Commit]
uses: ./.github/workflows/_codecov.yaml
with:
os: "ubuntu-latest"
Expand All @@ -115,6 +114,7 @@ jobs:
- Build-Docker
- CodeCov
- CodeQL
- Test
uses: ./.github/workflows/_pypi_test_publish.yaml
secrets:
API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
Expand All @@ -133,6 +133,7 @@ jobs:
- Build-Docker
- CodeCov
- CodeQL
- Test
uses: ./.github/workflows/_pypi_publish.yaml
secrets:
API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Expand All @@ -154,4 +155,8 @@ jobs:
- Build-Docker
- CodeCov
- CodeQL
- Test
uses: ./.github/workflows/_docker_publish.yaml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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: "15 5 * * 7"
push:
branches: ["master"]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
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: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0 # IMPORTANT: otherwise the current tag does not get fetched and the build version gets worse

- name: Run analysis
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
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#authentication-with-pat.
# 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

# 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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: results.sarif
1 change: 0 additions & 1 deletion tests/integration/test_integration_GridHODL.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ async def test_integration_GridHODL( # noqa: PLR0915

# Quick re-check ... the price update should not affect any orderbook
# changes when dropping.
current_orders = instance.orderbook.get_orders().all()
for order, price, volume in zip(
instance.orderbook.get_orders().all(),
(59405.9, 58817.7, 58235.3, 57658.7, 57087.8),
Expand Down

0 comments on commit 815324b

Please sign in to comment.