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.

121 lines
2.8 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 \
  76. --all-features \
  77. --exclude cp-benches "
  78. check_no_std:
  79. name: Check no_std
  80. runs-on: ubuntu-latest
  81. steps:
  82. - name: Checkout
  83. uses: actions/checkout@v2
  84. - name: Install Rust (${{ matrix.rust }})
  85. uses: actions-rs/toolchain@v1
  86. with:
  87. toolchain: stable
  88. target: thumbv6m-none-eabi
  89. override: true
  90. - name: Install Rust ARM64 (${{ matrix.rust }})
  91. uses: actions-rs/toolchain@v1
  92. with:
  93. toolchain: stable
  94. target: aarch64-unknown-none
  95. override: true
  96. - uses: actions/cache@v2
  97. with:
  98. path: |
  99. ~/.cargo/registry
  100. ~/.cargo/git
  101. target
  102. key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  103. - name: r1cs-std
  104. run: |
  105. cargo build --no-default-features --target aarch64-unknown-none
  106. cargo check --examples --no-default-features --target aarch64-unknown-none