Skip to content

Commit

Permalink
marge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced committed Jan 3, 2025
2 parents 5b4838d + 075c55b commit 7124b4f
Show file tree
Hide file tree
Showing 30 changed files with 334 additions and 173 deletions.
12 changes: 7 additions & 5 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM docker.io/debian:10

MAINTAINER Onur Özkan <onur@komodoplatform.com>
LABEL authors="Onur Özkan <onur@komodoplatform.com>"

RUN apt-get update -y

Expand All @@ -11,6 +11,7 @@ RUN apt-get install -y \
curl \
wget \
unzip \
libudev-dev \
gnupg

RUN ln -s /usr/bin/python3 /bin/python
Expand Down Expand Up @@ -49,8 +50,9 @@ RUN apt-get install -y \
docker-buildx-plugin

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain nightly-2023-06-01 -y

RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-linux-x86_64.zip
RUN unzip protoc-3.20.1-linux-x86_64.zip && mv ./include/google /usr/include/google

ENV PATH="/root/.cargo/bin:$PATH"
# TODO: Lock wasm-pack version
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash -s -- -y
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip
RUN unzip protoc-25.3-linux-x86_64.zip && mv ./include/google /usr/include/google

10 changes: 10 additions & 0 deletions .github/actions/build-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Set up build cache'
description: 'Sets up caching for KDF builds'
runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up rust-cache
uses: Swatinem/rust-cache@v2
20 changes: 0 additions & 20 deletions .github/actions/cargo-cache/action.yml

This file was deleted.

39 changes: 20 additions & 19 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -119,8 +119,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -180,8 +180,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -240,8 +240,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $Env:GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -303,8 +303,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -368,7 +368,8 @@ jobs:
rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash -s -- -y
# TODO: Lock wasm-pack version
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand All @@ -378,8 +379,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -430,8 +431,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -505,8 +506,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -582,8 +583,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/fmt-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
with:
deps: ('protoc' 'libudev-dev')

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: fmt check
# Format checks aren't OS dependant.
Expand All @@ -54,8 +54,8 @@ jobs:
with:
deps: ('protoc')

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: clippy lint
run: cargo clippy --target wasm32-unknown-unknown -- --D warnings
6 changes: 4 additions & 2 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
- name: Check PR labels
env:
LABEL_NAMES: ${{ toJson(github.event.pull_request.labels.*.name) }}
if: contains(env.LABEL_NAMES, 'under review') == contains(env.LABEL_NAMES, 'in progress')
if: "!((contains(env.LABEL_NAMES, 'pending review') && !contains(env.LABEL_NAMES, 'in progress') && !contains(env.LABEL_NAMES, 'blocked'))
|| (!contains(env.LABEL_NAMES, 'pending review') && contains(env.LABEL_NAMES, 'in progress') && !contains(env.LABEL_NAMES, 'blocked'))
|| (!contains(env.LABEL_NAMES, 'pending review') && !contains(env.LABEL_NAMES, 'in progress') && contains(env.LABEL_NAMES, 'blocked')))"
run: |
echo "PR must have "exactly one" of these labels: ['under review', 'in progress']."
echo "PR must have "exactly one" of these labels: ['status: pending review', 'status: in progress', 'status: blocked']."
exit 1
39 changes: 20 additions & 19 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -110,8 +110,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -165,8 +165,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -219,8 +219,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $Env:GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -275,8 +275,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -334,7 +334,8 @@ jobs:
rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash -s -- -y
# TODO: Lock wasm-pack version
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand All @@ -344,8 +345,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -393,8 +394,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -462,8 +463,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down Expand Up @@ -533,8 +534,8 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV

- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Build cache
uses: ./.github/actions/build-cache

- name: Build
run: |
Expand Down
Loading

0 comments on commit 7124b4f

Please sign in to comment.