Skip to content

Commit

Permalink
Update readme and github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
JobDoesburg committed Feb 11, 2025
1 parent e3f0528 commit 8fe1fe4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 41 deletions.
54 changes: 16 additions & 38 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build and Test
on:
push:
branches:
- 'dev'
- 'main'
pull_request:

Expand All @@ -16,48 +15,27 @@ jobs:
- uses: actions/checkout@v4
- uses: obi1kenobi/cargo-semver-checks-action@v2

check-versions:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
strategy:
matrix:
features:
- ""
- "elgamal3"
- "legacy-pep-repo-compatible"
- "elgamal3,legacy-pep-repo-compatible"

- name: Check versions
run: |
# Get package.json version
PKG_VERSION=$(node -p "require('./package.json').version")
# Get Cargo.toml version
CARGO_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')
echo "package.json version: $PKG_VERSION"
echo "Cargo.toml version: $CARGO_VERSION"
if [ "$PKG_VERSION" != "$CARGO_VERSION" ]; then
echo "Version mismatch:"
echo "package.json: $PKG_VERSION"
echo "Cargo.toml: $CARGO_VERSION"
exit 1
fi
echo "Versions match: $PKG_VERSION"
name: cargo test
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test --features "${{ matrix.features }}"

test:
build:
runs-on: ubuntu-latest
strategy:
matrix:
features:
features:
- ""
- "elgamal3"
- "legacy-pep-repo-compatible"
Expand All @@ -67,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test --features "${{ matrix.features }}"
- run: cargo build --release --features "${{ matrix.features }}"

build-wasm:
runs-on: ubuntu-latest
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/check-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Check versions

on:
push:
tags:
- v*

jobs:
semver-checks:
runs-on: ubuntu-latest

name: cargo semver-checks
steps:
- uses: actions/checkout@v4
- uses: obi1kenobi/cargo-semver-checks-action@v2

check-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Check versions
run: |
# Get package.json version
PKG_VERSION=$(node -p "require('./package.json').version")
# Get Cargo.toml version
CARGO_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')
echo "package.json version: $PKG_VERSION"
echo "Cargo.toml version: $CARGO_VERSION"
if [ "$PKG_VERSION" != "$CARGO_VERSION" ]; then
echo "Version mismatch:"
echo "package.json: $PKG_VERSION"
echo "Cargo.toml: $CARGO_VERSION"
exit 1
fi
echo "Versions match: $PKG_VERSION"
3 changes: 0 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
jobs:
lint:
runs-on: ubuntu-latest

name: cargo clippy
steps:
- uses: actions/checkout@v4
Expand All @@ -17,7 +16,6 @@ jobs:

fmt:
runs-on: ubuntu-latest

name: cargo fmt
steps:
- uses: actions/checkout@v4
Expand All @@ -26,7 +24,6 @@ jobs:

test:
runs-on: ubuntu-latest

name: cargo test
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# `libpep`: Library for polymorphic pseudonymization and encryption
[![Crates.io](https://img.shields.io/crates/v/libpep.svg)](https://crates.io/crates/libpep)
[![Downloads](https://img.shields.io/crates/d/libpep.svg)](https://crates.io/crates/libpep)
[![npm](https://img.shields.io/npm/v/@nolai/libpep-wasm.svg)](https://www.npmjs.com/package/@nolai/libpep-wasm)
[![Downloads](https://img.shields.io/npm/dm/@nolai/libpep-wasm.svg)](https://www.npmjs.com/package/@nolai/libpep-wasm)
[![License](https://img.shields.io/crates/l/libpep.svg)](https://crates.io/crates/libpep)
[![Documentation](https://docs.rs/libpep/badge.svg)](https://docs.rs/libpep)
[![Dependencies](https://deps.rs/repo/github/NOLAI/libpep/status.svg)](https://deps.rs/repo/github/NOLAI/libpep)

This library implements PEP cryptography based on ElGamal encrypted messages.
In the ElGamal scheme, a message `M` can be encrypted for a receiver which has public key `Y` associated with it, belonging to secret key `y`.
Expand Down

0 comments on commit 8fe1fe4

Please sign in to comment.