File tree Expand file tree Collapse file tree 3 files changed +28
-10
lines changed
crates/conformance-tests/src Expand file tree Collapse file tree 3 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 14
14
15
15
env :
16
16
CARGO_TERM_COLOR : always
17
- RUST_VERSION : 1.78
17
+ RUST_VERSION : " 1.80 "
18
18
jobs :
19
19
lint-rust :
20
20
name : Lint Rust
Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
- main
7
+ tags :
8
+ - " tests-v*"
7
9
8
10
env :
9
11
CARGO_TERM_COLOR : always
10
- RUST_VERSION : 1.78
12
+ RUST_VERSION : " 1.80 "
11
13
12
14
jobs :
13
15
build :
@@ -30,14 +32,27 @@ jobs:
30
32
with :
31
33
name : tests
32
34
path : tests.tar.gz
35
+
36
+ - name : set the release version (tag)
37
+ if : startsWith(github.ref, 'refs/tags/tests-v')
38
+ shell : bash
39
+ run : |
40
+ echo "RELEASE_VERSION=$(echo ${{ github.ref_name }} | cut -c 7-)" >> $GITHUB_ENV
41
+ echo "RELEASE_NOTE='The ${{ env.RELEASE_VERSION }} release of the conformance tests.'" >> $GITHUB_ENV
42
+
43
+ - name : set the release version (main)
44
+ if : github.ref == 'refs/heads/main'
45
+ shell : bash
46
+ run : |
47
+ echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
48
+ echo "RELEASE_NOTE='This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**.'" >> $GITHUB_ENV
33
49
34
50
- name : Recreate canary release
35
51
36
52
with :
37
- tag : canary
53
+ tag : " ${{ env.RELEASE_VERSION }} "
38
54
allowUpdates : true
39
55
prerelease : true
40
56
artifacts : " tests.tar.gz"
41
57
commit : ${{ github.sha }}
42
- body : |
43
- This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**.
58
+ body : " ${{ env.RELEASE_NOTE }}"
Original file line number Diff line number Diff line change @@ -4,10 +4,13 @@ use anyhow::Context as _;
4
4
use std:: path:: { Path , PathBuf } ;
5
5
6
6
/// Run the conformance tests
7
+ ///
8
+ /// The version is either 'canary' or a release tag like 'v0.1.0'.
7
9
pub fn run_tests (
10
+ version : & str ,
8
11
run : impl Fn ( Test ) -> anyhow:: Result < ( ) > + Send + Clone + ' static ,
9
12
) -> anyhow:: Result < ( ) > {
10
- let tests_dir = download_tests ( ) ?;
13
+ let tests_dir = download_tests ( version ) ?;
11
14
run_tests_from ( tests_dir, run)
12
15
}
13
16
@@ -28,10 +31,10 @@ pub fn run_tests_from(
28
31
}
29
32
30
33
/// Download the conformance tests and return the path to the directory where they are written to
31
- pub fn download_tests ( ) -> anyhow:: Result < std:: path:: PathBuf > {
32
- let response = reqwest:: blocking:: get (
33
- "https://github.com/fermyon/conformance-tests/releases/download/canary /tests.tar.gz" ,
34
- )
34
+ pub fn download_tests ( version : & str ) -> anyhow:: Result < std:: path:: PathBuf > {
35
+ let response = reqwest:: blocking:: get ( format ! (
36
+ "https://github.com/fermyon/conformance-tests/releases/download/{version} /tests.tar.gz"
37
+ ) )
35
38
. context ( "failed to send request" ) ?
36
39
. error_for_status ( ) ?;
37
40
let response = flate2:: read:: GzDecoder :: new ( response) ;
You can’t perform that action at this time.
0 commit comments