-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pavelnikolov/discrete-log-solution
discrete log solution
- Loading branch information
Showing
14 changed files
with
781 additions
and
194 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
client.Dockerfile | ||
server.Dockerfile | ||
README.md | ||
docker-compose.yml | ||
target/ |
This file contains 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,82 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
SERVER_IMAGE_NAME: pavelnikolov/zkpauth-server | ||
CLIENT_IMAGE_NAME: pavelnikolov/zkpauth-client | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for client images | ||
id: meta_client | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.CLIENT_IMAGE_NAME }} | ||
tags: | | ||
type=sha | ||
- name: Extract metadata (tags, labels) for server images | ||
id: meta_server | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.SERVER_IMAGE_NAME }} | ||
tags: | | ||
type=sha | ||
- name: Build and push client image | ||
id: push_client | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: . | ||
push: true | ||
file: client.Dockerfile | ||
tags: ${{ steps.meta_client.outputs.tags }} | ||
labels: ${{ steps.meta_client.outputs.labels }} | ||
|
||
- name: Build and push server image | ||
id: push_server | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: . | ||
push: true | ||
file: server.Dockerfile | ||
tags: ${{ steps.meta_server.outputs.tags }} | ||
labels: ${{ steps.meta_server.outputs.labels }} | ||
|
||
- name: Generate client image artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.CLIENT_IMAGE_NAME}} | ||
subject-digest: ${{ steps.push_client.outputs.digest }} | ||
push-to-registry: true | ||
|
||
|
||
- name: Generate server image artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.SERVER_IMAGE_NAME}} | ||
subject-digest: ${{ steps.push_server.outputs.digest }} | ||
push-to-registry: true |
This file contains 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,32 @@ | ||
name: Build and push Docker images | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup protocol buffers | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y protobuf-compiler | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: cargo build --verbose | ||
|
||
- name: Run tests | ||
run: cargo test --verbose | ||
|
||
- name: Run clippy | ||
run: cargo clippy --verbose |
This file contains 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,82 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug executable 'zkpauth-server'", | ||
"cargo": { | ||
"args": [ | ||
"build", | ||
"--bin=zkpauth-server", | ||
"--package=zkp-auth" | ||
], | ||
"filter": { | ||
"name": "zkpauth-server", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in executable 'zkpauth-server'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--bin=zkpauth-server", | ||
"--package=zkp-auth" | ||
], | ||
"filter": { | ||
"name": "zkpauth-server", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug executable 'zkpauth-client'", | ||
"cargo": { | ||
"args": [ | ||
"build", | ||
"--bin=zkpauth-client", | ||
"--package=zkp-auth" | ||
], | ||
"filter": { | ||
"name": "zkpauth-client", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in executable 'zkpauth-client'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--bin=zkpauth-client", | ||
"--package=zkp-auth" | ||
], | ||
"filter": { | ||
"name": "zkpauth-client", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.