Skip to content

Commit fe4cc15

Browse files
authored
Update MSRV to 1.60, add nix flake (#177)
* Add nix flake * Update gitignore * Add nix flake * Update to our toolchain action * Update to our toolchain action * Bump MSRV to 1.60 and remove deprecated toolchain args * Rust format component is needed * Fully specify rust version * Update changelog
1 parent 8e6c621 commit fe4cc15

File tree

8 files changed

+258
-138
lines changed

8 files changed

+258
-138
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/workflows/ci.yaml

Lines changed: 126 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
branches:
4-
- main
4+
- main
55
pull_request:
66

77
name: CI
@@ -12,22 +12,20 @@ jobs:
1212
name: Rustfmt
1313
runs-on: ubuntu-22.04
1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: Cache cargo
17-
uses: Swatinem/rust-cache@v1
18-
- uses: actions-rs/toolchain@v1
19-
with:
20-
profile: minimal
21-
toolchain: nightly
22-
override: true
23-
components: rustfmt
24-
- uses: actions-rs/cargo@v1
25-
with:
26-
command: fmt
27-
args: --all -- --check
28-
- name: Cancel workflow
29-
if: failure()
30-
uses: andymckay/cancel-action@0.2
15+
- uses: actions/checkout@v3
16+
- name: Cache cargo
17+
uses: Swatinem/rust-cache@v1
18+
- uses: IronCoreLabs/rust-toolchain@v1
19+
with:
20+
toolchain: nightly
21+
components: rustfmt
22+
- uses: actions-rs/cargo@v1
23+
with:
24+
command: fmt
25+
args: --all -- --check
26+
- name: Cancel workflow
27+
if: failure()
28+
uses: andymckay/cancel-action@0.2
3129

3230
# Build on all the architectures we intend to support, including cross compiled ones.
3331
build:
@@ -36,35 +34,34 @@ jobs:
3634
strategy:
3735
matrix:
3836
include:
39-
- os: ubuntu-22.04
40-
target: aarch64-linux-android # Android x64
41-
- os: ubuntu-22.04
42-
target: x86_64-unknown-linux-musl # Alpine Linux x86_64
43-
- os: ubuntu-22.04
44-
target: wasm32-unknown-unknown
45-
features: --features wasm --no-default-features
46-
- os: macos-12
47-
target: aarch64-apple-ios
48-
- os: macos-12
49-
target: x86_64-apple-darwin # 64-bit OSX
50-
- os: macos-12
51-
target: aarch64-apple-darwin # 64-bit M1 OSX
52-
- os: windows-2019
53-
target: x86_64-pc-windows-msvc
37+
- os: ubuntu-22.04
38+
target: aarch64-linux-android # Android x64
39+
- os: ubuntu-22.04
40+
target: x86_64-unknown-linux-musl # Alpine Linux x86_64
41+
- os: ubuntu-22.04
42+
target: wasm32-unknown-unknown
43+
features: --features wasm --no-default-features
44+
- os: macos-12
45+
target: aarch64-apple-ios
46+
- os: macos-12
47+
target: x86_64-apple-darwin # 64-bit OSX
48+
- os: macos-12
49+
target: aarch64-apple-darwin # 64-bit M1 OSX
50+
- os: windows-2019
51+
target: x86_64-pc-windows-msvc
5452
steps:
55-
- uses: actions/checkout@v2
56-
- name: Cache cargo
57-
uses: Swatinem/rust-cache@v1
58-
- uses: actions-rs/toolchain@v1
59-
with:
60-
toolchain: stable
61-
target: ${{ matrix.target }}
62-
override: true
63-
- uses: actions-rs/cargo@v1
64-
with:
65-
use-cross: true
66-
command: build
67-
args: --release --target=${{ matrix.target }} ${{ matrix.features }}
53+
- uses: actions/checkout@v2
54+
- name: Cache cargo
55+
uses: Swatinem/rust-cache@v1
56+
- uses: IronCoreLabs/rust-toolchain@v1
57+
with:
58+
toolchain: stable
59+
target: ${{ matrix.target }}
60+
- uses: actions-rs/cargo@v1
61+
with:
62+
use-cross: true
63+
command: build
64+
args: --release --target=${{ matrix.target }} ${{ matrix.features }}
6865

6966
# Run the tests on only one architecture, against various Rust versions.
7067
test:
@@ -73,22 +70,20 @@ jobs:
7370
strategy:
7471
matrix:
7572
rust:
76-
- stable
77-
- beta
78-
- 1.57 #MSRV
73+
- stable
74+
- beta
75+
- 1.60.0 #MSRV
7976
fail-fast: false
8077
steps:
81-
- uses: actions/checkout@v2
82-
- name: Cache cargo
83-
uses: Swatinem/rust-cache@v1
84-
- uses: actions-rs/toolchain@v1
85-
with:
86-
profile: minimal
87-
toolchain: ${{ matrix.rust }}
88-
override: true
89-
- uses: actions-rs/cargo@v1
90-
with:
91-
command: test
78+
- uses: actions/checkout@v2
79+
- name: Cache cargo
80+
uses: Swatinem/rust-cache@v1
81+
- uses: IronCoreLabs/rust-toolchain@v1
82+
with:
83+
toolchain: ${{ matrix.rust }}
84+
- uses: actions-rs/cargo@v1
85+
with:
86+
command: test
9287

9388
# Benchmark current and base revisions, if this is a PR.
9489
bench:
@@ -98,87 +93,83 @@ jobs:
9893
strategy:
9994
matrix:
10095
include:
101-
- name: current
102-
ref: ${{ github.ref }}
103-
- name: base
104-
ref: ${{ github.base_ref }}
96+
- name: current
97+
ref: ${{ github.ref }}
98+
- name: base
99+
ref: ${{ github.base_ref }}
105100
steps:
106-
- uses: actions/checkout@v2
107-
with:
108-
ref: ${{ matrix.ref }}
109-
- name: Cache cargo
110-
uses: Swatinem/rust-cache@v1
111-
- uses: actions-rs/toolchain@v1
112-
with:
113-
profile: minimal
114-
toolchain: stable
115-
override: true
116-
- uses: actions-rs/cargo@v1
117-
with:
118-
command: install
119-
args: critcmp
120-
- uses: actions-rs/cargo@v1
121-
with:
122-
command: bench
123-
args: -- --save-baseline ${{ matrix.name }}
124-
- run: critcmp --export ${{ matrix.name }} > results.json
125-
- name: Store benchmark results
126-
uses: actions/upload-artifact@v1
127-
with:
128-
name: bench-${{ matrix.name }}
129-
path: results.json
101+
- uses: actions/checkout@v2
102+
with:
103+
ref: ${{ matrix.ref }}
104+
- name: Cache cargo
105+
uses: Swatinem/rust-cache@v1
106+
- uses: IronCoreLabs/rust-toolchain@v1
107+
with:
108+
toolchain: stable
109+
- uses: actions-rs/cargo@v1
110+
with:
111+
command: install
112+
args: critcmp
113+
- uses: actions-rs/cargo@v1
114+
with:
115+
command: bench
116+
args: -- --save-baseline ${{ matrix.name }}
117+
- run: critcmp --export ${{ matrix.name }} > results.json
118+
- name: Store benchmark results
119+
uses: actions/upload-artifact@v1
120+
with:
121+
name: bench-${{ matrix.name }}
122+
path: results.json
130123

131124
# Add a comment to the PR with benchmark results. Only if everything else passed, and this is a PR.
132125
bench_results:
133126
needs:
134-
- bench
127+
- bench
135128
name: Upload benchmark results
136129
runs-on: ubuntu-22.04
137130
steps:
138-
- uses: actions/checkout@v2
139-
- name: Cache cargo
140-
uses: Swatinem/rust-cache@v1
141-
- name: Retrieve benchmark results
142-
uses: actions/download-artifact@v1
143-
with:
144-
name: bench-current
145-
- name: Delete artifact
146-
uses: geekyeggo/delete-artifact@v1
147-
with:
148-
name: bench-current
149-
failOnError: false
150-
- name: Retrieve benchmark results
151-
uses: actions/download-artifact@v1
152-
with:
153-
name: bench-base
154-
- name: Delete artifact
155-
uses: geekyeggo/delete-artifact@v1
156-
with:
157-
name: bench-base
158-
failOnError: false
159-
- uses: actions-rs/toolchain@v1
160-
with:
161-
profile: minimal
162-
toolchain: stable
163-
override: true
164-
- uses: actions-rs/cargo@v1
165-
with:
166-
command: install
167-
args: critcmp
168-
- name: Compare benchmarks
169-
run: |
170-
if ! critcmp bench-base/results.json bench-current/results.json -t 10 ; then
171-
echo "# Benchmark blew big budget! Bad!" > comment.md
172-
fi
173-
echo "Benchmark results comparing with base:" >> comment.md
174-
echo '```' >> comment.md
175-
critcmp bench-base/results.json bench-current/results.json -t 2 >> comment.md || true
176-
echo '```' >> comment.md
177-
cat comment.md
178-
mv comment.md .github/workflows/comment.md
179-
# This will post a comment to the PR with benchmark results, but it's disabled because it's annoying.
180-
# - uses: harupy/comment-on-pr@c0522c4
181-
# env:
182-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183-
# with:
184-
# filename: comment.md
131+
- uses: actions/checkout@v2
132+
- name: Cache cargo
133+
uses: Swatinem/rust-cache@v1
134+
- name: Retrieve benchmark results
135+
uses: actions/download-artifact@v1
136+
with:
137+
name: bench-current
138+
- name: Delete artifact
139+
uses: geekyeggo/delete-artifact@v1
140+
with:
141+
name: bench-current
142+
failOnError: false
143+
- name: Retrieve benchmark results
144+
uses: actions/download-artifact@v1
145+
with:
146+
name: bench-base
147+
- name: Delete artifact
148+
uses: geekyeggo/delete-artifact@v1
149+
with:
150+
name: bench-base
151+
failOnError: false
152+
- uses: IronCoreLabs/rust-toolchain@v1
153+
with:
154+
toolchain: stable
155+
- uses: actions-rs/cargo@v1
156+
with:
157+
command: install
158+
args: critcmp
159+
- name: Compare benchmarks
160+
run: |
161+
if ! critcmp bench-base/results.json bench-current/results.json -t 10 ; then
162+
echo "# Benchmark blew big budget! Bad!" > comment.md
163+
fi
164+
echo "Benchmark results comparing with base:" >> comment.md
165+
echo '```' >> comment.md
166+
critcmp bench-base/results.json bench-current/results.json -t 2 >> comment.md || true
167+
echo '```' >> comment.md
168+
cat comment.md
169+
mv comment.md .github/workflows/comment.md
170+
# This will post a comment to the PR with benchmark results, but it's disabled because it's annoying.
171+
# - uses: harupy/comment-on-pr@c0522c4
172+
# env:
173+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
174+
# with:
175+
# filename: comment.md

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ target/
33
Cargo.lock
44
.idea
55
*.iml
6-
*.code-workspace
6+
*.code-workspace
7+
.direnv

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Changelog
22

33
## Unreleased
4-
- [[#175](https://github.com/IronCoreLabs/recrypt-rs/pull/175)]
4+
5+
- [[#177](https://github.com/IronCoreLabs/recrypt-rs/pull/177)]
6+
- Change MSRV to Rust 1.60.0
7+
- [[#175](https://github.com/IronCoreLabs/recrypt-rs/pull/175)]
58
- Change MSRV to Rust 1.57.0
69

710
## 0.13.1 (2021-11-29)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ categories = ["cryptography", "algorithms"]
1010
keywords = ["cryptography", "proxy-re-encryption", "PRE", "ECC", "transform-encryption"]
1111
description = "A pure-Rust implementation of Transform Encryption, a Proxy Re-encryption scheme"
1212
edition = "2021"
13-
rust-version = "1.57.0"
13+
rust-version = "1.60.0"
1414

1515
[target.'cfg(all(unix, not(target_arch = "wasm32")))'.dependencies]
1616
libc = {version = "0.2"}

0 commit comments

Comments
 (0)