Skip to content

Commit

Permalink
update ci/cd pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
remicolin committed Dec 18, 2024
1 parent 307b468 commit ea6163d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
branches:
- dev
- main
- openpassportv2
paths:
- 'circuits/**'
- 'common/**'
pull_request:
branches:
- dev
- main
- openpassportv2
paths:
- 'circuits/**'
- 'common/**'
Expand Down Expand Up @@ -59,6 +61,8 @@ jobs:

- name: Run Tests (Circuits)
working-directory: ./circuits
env:
FULL_TEST_SUITE: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/openpassportv2' }}
run: yarn test

- name: Run Tests (Common)
Expand Down
9 changes: 8 additions & 1 deletion circuits/tests/dsc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ import { max_cert_bytes } from '../../common/src/constants/constants';
import { getCircuitName } from '../../common/src/utils/certificates/handleCertificate';

const sigAlgs = [
{ sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '4096' },
];

const fullSigAlgs = [
{ sigAlg: 'rsa', hashFunction: 'sha1', domainParameter: '65537', keyLength: '4096' },
{ sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '4096' },
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '4096' },
];

sigAlgs.forEach(({ sigAlg, hashFunction, domainParameter, keyLength }) => {
// Use environment variable to determine which test suite to run
const testSuite = process.env.FULL_TEST_SUITE === 'true' ? fullSigAlgs : sigAlgs;

testSuite.forEach(({ sigAlg, hashFunction, domainParameter, keyLength }) => {
describe(`DSC chain certificate - ${hashFunction.toUpperCase()} ${sigAlg.toUpperCase()}`, function () {
this.timeout(0); // Disable timeout
let circuit;
Expand Down
30 changes: 19 additions & 11 deletions circuits/tests/prove.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@ import { SMT } from '@openpassport/zk-kit-smt';
import namejson from '../../common/ofacdata/outputs/nameSMT.json';

const sigAlgs = [
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '3', keyLength: '3072' },
{ sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '3072' },
{ sigAlg: 'ecdsa', hashFunction: 'sha1', domainParameter: 'secp256r1', keyLength: '256' },
];

const fullSigAlgs = [
{ sigAlg: 'rsa', hashFunction: 'sha1', domainParameter: '65537', keyLength: '2048' },
// { sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '2048' },
// { sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '2048' },
// { sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '3072' },
// { sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '4096' },
// { sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '3', keyLength: '4096' },
// { sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '3', keyLength: '3072' },
// { sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '3', keyLength: '2048' },
// { sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '3072' },
// { sigAlg: 'ecdsa', hashFunction: 'sha256', domainParameter: 'secp256r1', keyLength: '256' },
// { sigAlg: 'ecdsa', hashFunction: 'sha1', domainParameter: 'secp256r1', keyLength: '256' },
{ sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '2048' },
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '2048' },
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '3072' },
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '65537', keyLength: '4096' },
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '3', keyLength: '4096' },
{ sigAlg: 'rsapss', hashFunction: 'sha256', domainParameter: '3', keyLength: '3072' },
{ sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '3', keyLength: '2048' },
{ sigAlg: 'rsa', hashFunction: 'sha256', domainParameter: '65537', keyLength: '3072' },
{ sigAlg: 'ecdsa', hashFunction: 'sha256', domainParameter: 'secp256r1', keyLength: '256' },
{ sigAlg: 'ecdsa', hashFunction: 'sha1', domainParameter: 'secp256r1', keyLength: '256' },
];

sigAlgs.forEach(({ sigAlg, hashFunction, domainParameter, keyLength }) => {
const testSuite = process.env.FULL_TEST_SUITE === 'true' ? fullSigAlgs : sigAlgs;

testSuite.forEach(({ sigAlg, hashFunction, domainParameter, keyLength }) => {
describe(`Prove - ${hashFunction.toUpperCase()} ${sigAlg.toUpperCase()} ${domainParameter} ${keyLength}`, function () {
this.timeout(0);
let circuit: any;
Expand Down
10 changes: 5 additions & 5 deletions circuits/tests/utils/rsaPkcs1v1_5.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { SignatureAlgorithm } from '../../../common/src/utils/types';

describe('VerifyRsaPkcs1v1_5 Circuit Test', function () {
this.timeout(0);

/** Some tests are disabled to avoid overloading the CI/CD pipeline - the commented rsa verifications will however be tested in prove.test.ts and dsc.test.ts **/
const rsaAlgorithms: SignatureAlgorithm[] = [
'rsa_sha1_65537_2048',
'rsa_sha256_65537_2048',
// 'rsa_sha1_65537_2048',
// 'rsa_sha256_65537_2048',
'rsa_sha256_3_2048',
'rsa_sha256_65537_3072',
'rsa_sha256_65537_4096',
// 'rsa_sha256_65537_3072',
// 'rsa_sha256_65537_4096',
'rsa_sha512_65537_4096',
];

Expand Down

0 comments on commit ea6163d

Please sign in to comment.