Skip to content

Commit bf741cc

Browse files
Merge pull request #32 from sebastienrousseau/feat/kyberlib
v0.0.4
2 parents 482d2de + c41b350 commit bf741cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2391
-1122
lines changed

.cargo/config.toml

-2
This file was deleted.

.github/workflows/audit.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: 🧪 Audit
33
on:
44
push:
55
branches:
6+
- main
67
- feat/kyberlib
78
pull_request:
89
branches:
@@ -18,6 +19,10 @@ jobs:
1819
- uses: hecrj/setup-rust-action@v2
1920
- name: Install cargo-audit
2021
run: cargo install cargo-audit
22+
2123
- uses: actions/checkout@v4
22-
- name: Audit dependencies
23-
run: cargo audit
24+
- name: Resolve dependencies
25+
run: cargo update
26+
27+
- name: Audit vulnerabilities
28+
run: cargo audit

.github/workflows/check.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: 🧪 Check
33
on:
44
push:
55
branches:
6+
- main
67
- feat/kyberlib
78
pull_request:
89
branches:
@@ -20,4 +21,4 @@ jobs:
2021
components: clippy
2122
- uses: actions/checkout@v4
2223
- name: Check lints
23-
run: cargo check --all-targets --workspace --all-features
24+
run: cargo check --all-targets --workspace --all-features

.github/workflows/coverage.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: 📶 Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
coverage:
14+
name: Code Coverage
15+
runs-on: ubuntu-latest
16+
env:
17+
CARGO_INCREMENTAL: "0"
18+
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
19+
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
20+
21+
steps:
22+
# Checkout the repository
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
# Setup Rust nightly
27+
- name: Install Rust
28+
uses: actions-rs/toolchain@v1
29+
id: toolchain
30+
with:
31+
toolchain: nightly
32+
override: true
33+
34+
# Configure cache for Cargo
35+
- name: Cache Cargo registry, index
36+
uses: actions/cache@v4
37+
id: cache-cargo
38+
with:
39+
path: |
40+
~/.cargo/registry
41+
~/.cargo/bin
42+
~/.cargo/git
43+
key: linux-${{ steps.toolchain.outputs.rustc_hash }}-rust-cov-${{ hashFiles('**/Cargo.lock') }}
44+
45+
# Run tests with all features
46+
- name: Test (cargo test)
47+
uses: actions-rs/cargo@v1
48+
with:
49+
command: test
50+
args: "--workspace"
51+
52+
# Install grcov
53+
- uses: actions-rs/[email protected]
54+
id: coverage
55+
56+
# Upload to Codecov.io
57+
- name: Upload to Codecov.io
58+
uses: codecov/codecov-action@v4
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
file: ${{ steps.coverage.outputs.report }}

.github/workflows/document.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ jobs:
5050
- name: Deploy to GitHub Pages
5151
uses: peaceiris/actions-gh-pages@v4
5252
with:
53-
github_token: ${{ secrets.GITHUB_TOKEN }}
54-
publish_dir: ./target/doc
55-
publish_branch: gh-pages
5653
cname: true
57-
clean: true
5854
commit_message: Deploy documentation at ${{ github.sha }}
59-
commit_user_name: github-actions
60-
commit_user_email: [email protected]
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
publish_branch: gh-pages
57+
publish_dir: ./target/doc
58+
user_email: [email protected]
59+
user_name: github-actions

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
components: clippy
2121
- uses: actions/checkout@v4
2222
- name: Check lints
23-
run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings
23+
run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings

.github/workflows/release.yml

+19-108
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: 🧪 Release
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- feat/kyberlib
8+
pull_request:
9+
branches:
10+
- feat/kyberlib
11+
release:
12+
types: [created]
413

514
concurrency:
615
group: ${{ github.ref }}
@@ -21,113 +30,25 @@ jobs:
2130
BUILD_ID: ${{ github.run_id }}
2231
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }}
2332
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
OS: ${{ matrix.os }}
25-
TARGET: ${{ matrix.target }}
33+
OS: ${{ matrix.platform.os }}
34+
TARGET: ${{ matrix.platform.target }}
2635

2736
strategy:
2837
fail-fast: false
2938
matrix:
30-
target:
31-
# List of targets:
32-
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
33-
34-
# Tier 1 platforms 🏆
35-
- aarch64-unknown-linux-gnu # 64-bit Linux systems on ARM architecture
36-
- i686-pc-windows-gnu # 32-bit Windows (i686-pc-windows-gnu)
37-
- i686-pc-windows-msvc # 32-bit Windows (i686-pc-windows-msvc)
38-
- i686-unknown-linux-gnu # 32-bit Linux (kernel 3.2+, glibc 2.17+)
39-
- x86_64-apple-darwin # 64-bit macOS (10.7 Lion or later)
40-
- x86_64-pc-windows-gnu # 64-bit Windows (x86_64-pc-windows-gnu)
41-
- x86_64-pc-windows-msvc # 64-bit Windows (x86_64-pc-windows-msvc)
42-
- x86_64-unknown-linux-gnu # 64-bit Linux (kernel 2.6.32+, glibc 2.11+)
43-
44-
# Tier 2 platforms 🥈
45-
- aarch64-apple-darwin # 64-bit macOS on Apple Silicon
46-
- aarch64-pc-windows-msvc # 64-bit Windows (aarch64-pc-windows-msvc)
47-
- aarch64-unknown-linux-musl # 64-bit Linux systems on ARM architecture
48-
- arm-unknown-linux-gnueabi # ARMv6 Linux (kernel 3.2, glibc 2.17)
49-
- arm-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
50-
- armv7-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
51-
- powerpc-unknown-linux-gnu # PowerPC Linux (kernel 3.2, glibc 2.17)
52-
- powerpc64-unknown-linux-gnu # PowerPC64 Linux (kernel 3.2, glibc 2.17)
53-
- powerpc64le-unknown-linux-gnu # PowerPC64le Linux (kernel 3.2, glibc 2.17)
54-
- riscv64gc-unknown-linux-gnu # RISC-V Linux (kernel 3.2, glibc 2.17)
55-
- s390x-unknown-linux-gnu # s390x Linux (kernel 3.2, glibc 2.17)
56-
- x86_64-unknown-freebsd # 64-bit FreeBSD on x86-64
57-
- x86_64-unknown-linux-musl # 64-bit Linux (kernel 2.6.32+, musl libc)
58-
59-
include:
60-
# Tier 1 platforms 🏆
61-
- target: aarch64-unknown-linux-gnu
62-
os: ubuntu-latest
63-
cross: true
64-
- target: i686-pc-windows-gnu
65-
os: ubuntu-latest
66-
cross: true
67-
- target: i686-pc-windows-msvc
39+
platform:
40+
- target: x86_64-pc-windows-msvc
41+
os: windows-latest
42+
- target: aarch64-pc-windows-msvc
6843
os: windows-latest
69-
cross: true
70-
- target: i686-unknown-linux-gnu
71-
os: ubuntu-latest
72-
cross: true
7344
- target: x86_64-apple-darwin
7445
os: macos-latest
75-
cross: true
76-
- target: x86_64-pc-windows-gnu
77-
os: ubuntu-latest
78-
cross: true
79-
- target: x86_64-pc-windows-msvc
80-
os: windows-latest
81-
cross: true
82-
- target: x86_64-unknown-linux-gnu
83-
os: ubuntu-latest
84-
cross: true
85-
86-
# Tier 2 platforms 🥈
8746
- target: aarch64-apple-darwin
8847
os: macos-latest
89-
cross: true
90-
- target: aarch64-pc-windows-msvc
91-
os: windows-latest
92-
cross: true
93-
- target: aarch64-unknown-linux-musl
94-
os: ubuntu-latest
95-
cross: true
96-
- target: arm-unknown-linux-gnueabi
97-
os: ubuntu-latest
98-
cross: true
99-
- target: arm-unknown-linux-gnueabihf
100-
os: ubuntu-latest
101-
cross: true
102-
- target: armv7-unknown-linux-gnueabihf
103-
os: ubuntu-latest
104-
cross: true
105-
- target: powerpc-unknown-linux-gnu
106-
os: ubuntu-latest
107-
cross: true
108-
- target: powerpc64-unknown-linux-gnu
109-
os: ubuntu-latest
110-
cross: true
111-
- target: powerpc64le-unknown-linux-gnu
112-
os: ubuntu-latest
113-
cross: true
114-
- target: riscv64gc-unknown-linux-gnu
115-
os: ubuntu-latest
116-
cross: true
117-
- target: s390x-unknown-linux-gnu
118-
os: ubuntu-latest
119-
cross: true
120-
- target: x86_64-unknown-freebsd
121-
os: ubuntu-latest
122-
cross: true
123-
- target: x86_64-unknown-linux-musl
48+
- target: x86_64-unknown-linux-gnu
12449
os: ubuntu-latest
125-
cross: true
126-
# - target: x86_64-unknown-netbsd
127-
# os: ubuntu-latest
128-
# cross: true
12950

130-
runs-on: ${{ matrix.os }}
51+
runs-on: ${{ matrix.platform.os }}
13152

13253
steps:
13354
# Check out the repository code.
@@ -157,21 +78,11 @@ jobs:
15778
id: install-target
15879
run: rustup target add ${{ env.TARGET }}
15980

160-
- name: Install Cross and clean artifacts
161-
run: |
162-
# Install cross
163-
cargo install cross
164-
165-
# Clean the build artifacts
166-
cargo clean --verbose
167-
shell: bash
168-
16981
# Build the targets
17082
- name: Build targets
17183
id: build-targets
17284
uses: actions-rs/cargo@v1
17385
with:
174-
use-cross: true
17586
command: build
17687
args: --verbose --workspace --release --target ${{ env.TARGET }}
17788

@@ -337,4 +248,4 @@ jobs:
337248
with:
338249
command: publish
339250
args: "--no-verify --allow-dirty"
340-
use-cross: false
251+
use-cross: false

.github/workflows/test.yml

+1-30
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,4 @@ jobs:
3737
# Run tests with all features
3838
- name: Run tests with all features
3939
id: run-tests-all-features
40-
run: cargo test --verbose --workspace --all-features
41-
42-
# Install grcov
43-
- name: Install grcov
44-
# Only run this job on the main branch when a commit is pushed.
45-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
46-
id: install-grcov
47-
run: |
48-
mkdir -p "${HOME}/.local/bin"
49-
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin"
50-
echo "$HOME/.local/bin" >> $GITHUB_PATH
51-
52-
# Use grcov to generate a coverage report
53-
- name: Generate coverage report
54-
# Only run this job on the main branch when a commit is pushed.
55-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
56-
id: generate-code-coverage
57-
uses: actions-rs/cargo@v1
58-
with:
59-
command: xtask
60-
args: coverage
61-
62-
# Upload the coverage report to codecov
63-
- name: Upload coverage report to codecov
64-
# Only run this job on the main branch when a commit is pushed.
65-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
66-
id: upload-report-codecov
67-
uses: codecov/codecov-action@v4
68-
with:
69-
files: coverage/*.lcov
40+
run: cargo test --verbose --workspace --all-features

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ build
88
Icon?
99
src/.DS_Store
1010
tarpaulin-report.html
11+
Cargo.lock

0 commit comments

Comments
 (0)