You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
4.4 KiB

  1. name: CI
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - master
  7. env:
  8. RUST_BACKTRACE: 1
  9. jobs:
  10. style:
  11. name: Check Style
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout
  15. uses: actions/checkout@v1
  16. - name: Install Rust
  17. uses: actions-rs/toolchain@v1
  18. with:
  19. profile: minimal
  20. toolchain: stable
  21. override: true
  22. components: rustfmt
  23. - name: cargo fmt --check
  24. uses: actions-rs/cargo@v1
  25. with:
  26. command: fmt
  27. args: --all -- --check
  28. test:
  29. name: Test
  30. runs-on: ubuntu-latest
  31. env:
  32. RUSTFLAGS: -Dwarnings
  33. strategy:
  34. matrix:
  35. rust:
  36. - stable
  37. - nightly
  38. steps:
  39. - name: Checkout
  40. uses: actions/checkout@v2
  41. - name: Install Rust (${{ matrix.rust }})
  42. uses: actions-rs/toolchain@v1
  43. with:
  44. profile: minimal
  45. toolchain: ${{ matrix.rust }}
  46. override: true
  47. - uses: actions/cache@v2
  48. with:
  49. path: |
  50. ~/.cargo/registry
  51. ~/.cargo/git
  52. target
  53. key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  54. - name: Check examples
  55. uses: actions-rs/cargo@v1
  56. with:
  57. command: check
  58. args: --examples --all
  59. - name: Check examples with all features on stable
  60. uses: actions-rs/cargo@v1
  61. with:
  62. command: check
  63. args: --examples --all-features --all
  64. if: matrix.rust == 'stable'
  65. - name: Check benchmarks on nightly
  66. uses: actions-rs/cargo@v1
  67. with:
  68. command: check
  69. args: --all-features --examples --all --benches
  70. if: matrix.rust == 'nightly'
  71. - name: Test
  72. uses: actions-rs/cargo@v1
  73. with:
  74. command: test
  75. args: --all -- --skip dpc --skip integration_test
  76. check_no_std:
  77. name: Check no_std
  78. runs-on: ubuntu-latest
  79. steps:
  80. - name: Checkout
  81. uses: actions/checkout@v2
  82. - name: Install Rust (${{ matrix.rust }})
  83. uses: actions-rs/toolchain@v1
  84. with:
  85. toolchain: stable
  86. target: thumbv6m-none-eabi
  87. override: true
  88. - uses: actions/cache@v2
  89. with:
  90. path: |
  91. ~/.cargo/registry
  92. ~/.cargo/git
  93. target
  94. key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  95. - name: algebra-core
  96. run: |
  97. cd algebra-core
  98. cargo build -p algebra-core --no-default-features --target thumbv6m-none-eabi
  99. cargo check --examples -p algebra-core --no-default-features --target thumbv6m-none-eabi
  100. cd ..
  101. - name: algebra
  102. run: |
  103. cd algebra
  104. cargo build -p algebra --no-default-features --target thumbv6m-none-eabi
  105. cargo check --examples -p algebra --no-default-features --target thumbv6m-none-eabi
  106. cd ..
  107. - name: r1cs-core
  108. run: |
  109. cd r1cs-core
  110. cargo build -p r1cs-core --no-default-features --target thumbv6m-none-eabi
  111. cargo check --examples -p r1cs-core --no-default-features --target thumbv6m-none-eabi
  112. cd ..
  113. - name: r1cs-std
  114. run: |
  115. cd r1cs-std
  116. cargo build -p r1cs-std --no-default-features --target thumbv6m-none-eabi
  117. cargo check --examples -p r1cs-std --no-default-features --target thumbv6m-none-eabi
  118. cd ..
  119. - name: ff-fft
  120. run: |
  121. cd ff-fft
  122. cargo build -p ff-fft --no-default-features --target thumbv6m-none-eabi
  123. cargo check --examples -p ff-fft --no-default-features --target thumbv6m-none-eabi
  124. cd ..
  125. - name: groth16
  126. run: |
  127. cd groth16
  128. cargo build -p groth16 --no-default-features --target thumbv6m-none-eabi
  129. cargo check --examples -p groth16 --no-default-features --target thumbv6m-none-eabi
  130. cd ..
  131. - name: gm17
  132. run: |
  133. cd gm17
  134. cargo build -p gm17 --no-default-features --target thumbv6m-none-eabi
  135. cargo check --examples -p gm17 --no-default-features --target thumbv6m-none-eabi
  136. cd ..
  137. - name: crypto-primitives
  138. run: |
  139. cd crypto-primitives
  140. cargo build -p crypto-primitives --no-default-features --target thumbv6m-none-eabi
  141. cargo check --examples -p crypto-primitives --no-default-features --target thumbv6m-none-eabi
  142. cd ..