refactor: Fix github build pipeline
This commit is contained in:
parent
7564869ea8
commit
8e9388c353
5 changed files with 60 additions and 9 deletions
2
.github/workflows/kauma.yaml
vendored
2
.github/workflows/kauma.yaml
vendored
|
|
@ -66,4 +66,4 @@ jobs:
|
||||||
docker tag ghcr.io/johndoe31415/labwork-docker:master labwork
|
docker tag ghcr.io/johndoe31415/labwork-docker:master labwork
|
||||||
- name: Run labwork container
|
- name: Run labwork container
|
||||||
run: |
|
run: |
|
||||||
docker run -v $PWD:/dut/ labwork /bin/bash -c '/dut/build && /dut/kauma ./example_challenges/block2poly.json'
|
docker run -v $PWD:/dut/ labwork /bin/bash -c '/dut/build && /dut/kauma ./test_json/kauma_tests.json'
|
||||||
|
|
|
||||||
7
build
7
build
|
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
|
|
||||||
export OPENSSL_INCLUDE_DIR=/usr/include/openssl
|
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
cd $SCRIPT_DIR
|
cd $SCRIPT_DIR
|
||||||
cargo build --release --locked --offline
|
|
||||||
|
ln -s /rust/vendor $SCRIPT_DIR/vendor
|
||||||
|
|
||||||
|
cargo build --release --offline
|
||||||
|
|
|
||||||
5
kauma
5
kauma
|
|
@ -1,7 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
|
|
||||||
export OPENSSL_INCLUDE_DIR=/usr/include/openssl
|
|
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
cd $SCRIPT_DIR
|
cd $SCRIPT_DIR
|
||||||
cargo run --release --locked --offline -- $@
|
cargo run --release --locked --offline -- --verbose $@
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::utils::parse::{Responses, Testcase, Testcases};
|
use crate::utils::parse::{Responses, Testcase, Testcases};
|
||||||
use tasks01::{block2poly::block2poly, poly2block::poly2block, sea128::sea128};
|
use tasks01::{block2poly::block2poly, gfmul::gfmul, poly2block::poly2block, sea128::sea128};
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
@ -34,6 +34,11 @@ pub fn task_deploy(testcase: &Testcase) -> Result<Value> {
|
||||||
let json = json!({"output" : result});
|
let json = json!({"output" : result});
|
||||||
Ok(json)
|
Ok(json)
|
||||||
}
|
}
|
||||||
|
"gfmul" => {
|
||||||
|
let result = gfmul(args)?;
|
||||||
|
let json = json!({"product" : result});
|
||||||
|
Ok(json)
|
||||||
|
}
|
||||||
_ => Err(anyhow!(
|
_ => Err(anyhow!(
|
||||||
"Fatal. No compatible action found. Json data was {:?}. Arguments were; {:?}",
|
"Fatal. No compatible action found. Json data was {:?}. Arguments were; {:?}",
|
||||||
testcase,
|
testcase,
|
||||||
|
|
|
||||||
48
src/test_json/kauma_tests.json
Normal file
48
src/test_json/kauma_tests.json
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"testcases": {
|
||||||
|
"b856d760-023d-4b00-bad2-15d2b6da22fe": {
|
||||||
|
"action": "block2poly",
|
||||||
|
"arguments": {
|
||||||
|
"semantic": "xex",
|
||||||
|
"block": "ARIAAAAAAAAAAAAAAAAAgA=="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"254eaee7-05fd-4e0d-8292-9b658a852245": {
|
||||||
|
"action": "poly2block",
|
||||||
|
"arguments": {
|
||||||
|
"semantic": "xex",
|
||||||
|
"coefficients": [
|
||||||
|
12,
|
||||||
|
127,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"254eaee7-05fd-4e0d-8292-9b658a852245": {
|
||||||
|
"action": "gfmul",
|
||||||
|
"arguments": {
|
||||||
|
"semantic": "xex",
|
||||||
|
"a": "ARIAAAAAAAAAAAAAAAAAgA==",
|
||||||
|
"b": "AgAAAAAAAAAAAAAAAAAAAA=="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b856d760-023d-4b00-bad2-15d2b6da22fe": {
|
||||||
|
"action": "sea128",
|
||||||
|
"arguments": {
|
||||||
|
"mode": "encrypt",
|
||||||
|
"key": "istDASeincoolerKEYrofg==",
|
||||||
|
"input": "yv66vvrO263eyviIiDNEVQ=="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"254eaee7-05fd-4e0d-8292-9b658b852245": {
|
||||||
|
"action": "sea128",
|
||||||
|
"arguments": {
|
||||||
|
"mode": "decrypt",
|
||||||
|
"key": "istDASeincoolerKEYrofg==",
|
||||||
|
"input": "D5FDo3iVBoBN9gVi9/MSKQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue