Skip to content

Commit fcd5609

Browse files
ci: fix windows tests with .exe suffix (#111)
Co-authored-by: Oleksandr Zarudnyi <[email protected]>
1 parent 70e2840 commit fcd5609

File tree

5 files changed

+55
-35
lines changed

5 files changed

+55
-35
lines changed

.github/actions/cli-tests/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ runs:
5353
working-directory: cli-tests
5454
run: |
5555
npm install
56-
which solc
57-
which zksolc
58-
solc --version
59-
zksolc --version
6056
npx jest --ci --reporters=default --reporters=jest-junit
6157
6258
- name: Upload results Linux

.github/actions/install-solc/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ runs:
4646
SOLC_DOWNLOAD_FILENAME="solc-macosx-amd64-${SOLC_VERSION}"
4747
;;
4848
Windows*)
49+
WIN_SUFFIX=".exe"
4950
SOLC_DOWNLOAD_FILENAME="solc-windows-amd64-${SOLC_VERSION}.exe"
5051
;;
5152
esac
53+
OUTPUT="${OUTPUT}${WIN_SUFFIX}"
5254
curl --location -o "${OUTPUT}" "${SOLC_URL}/${SOLC_VERSION}/${SOLC_DOWNLOAD_FILENAME}" && \
5355
chmod a+x "${OUTPUT}"
54-
[ ${SOLC_VERSION} = ${{ inputs.solc-version-latest }} ] && cp "${OUTPUT}" "${{ inputs.output-dir }}/${{ inputs.solc-default-name }}" && cp "${OUTPUT}" "${{ inputs.solc-default-name }}"
56+
[ ${SOLC_VERSION} = ${{ inputs.solc-version-latest }} ] && cp "${OUTPUT}" "${{ inputs.output-dir }}/${{ inputs.solc-default-name }}${WIN_SUFFIX}"
5557
done
5658
echo "${PWD}/${{ inputs.output-dir }}" >> "${GITHUB_PATH}"
57-
58-
# Tweak
59-
echo "${PWD}" >> "${GITHUB_PATH}"
59+
ls -la ${PWD}/${{ inputs.output-dir }}
6060
6161
- name: Install upstream solc on Windows
6262
if: runner.os == 'Windows'
@@ -69,6 +69,6 @@ runs:
6969
curl --location -o "${SOLC_DOWNLOAD}.zip" "${SOLC_URL}/${SOLC_DOWNLOAD}.zip"
7070
unzip -d ${SOLC_DOWNLOAD} "${SOLC_DOWNLOAD}.zip"
7171
SOLC_SHORT_VERSION=$(echo "${SOLC_VERSION}" | cut -d+ -f1 | tr -d v)
72-
mv "${SOLC_DOWNLOAD}/solc.exe" "${{ inputs.output-dir }}/${{ inputs.solc-default-name }}-${SOLC_SHORT_VERSION}"
72+
mv "${SOLC_DOWNLOAD}/solc.exe" "${{ inputs.output-dir }}/${{ inputs.solc-default-name }}-${SOLC_SHORT_VERSION}.exe"
7373
done
74-
ls -la "${PWD}/${{ inputs.output-dir }}"
74+
ls -la ${PWD}/${{ inputs.output-dir }}

.github/workflows/test.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ jobs:
3535
fail-fast: false # finalize testing of all targets even if one failed
3636
matrix:
3737
include:
38-
# - name: "MacOS x86"
39-
# runner: macos-12-large
40-
# - name: "MacOS arm64"
41-
# runner: [self-hosted, macOS, ARM64]
42-
# - name: "Linux x86"
43-
# runner: matterlabs-ci-runner
44-
# image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
45-
# target: "x86_64-unknown-linux-musl"
46-
# - name: "Linux ARM64"
47-
# runner: matterlabs-ci-runner-arm
48-
# image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
49-
# target: "aarch64-unknown-linux-musl"
38+
- name: "MacOS x86"
39+
runner: macos-12-large
40+
- name: "MacOS arm64"
41+
runner: [self-hosted, macOS, ARM64]
42+
- name: "Linux x86"
43+
runner: matterlabs-ci-runner
44+
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
45+
target: "x86_64-unknown-linux-musl"
46+
- name: "Linux ARM64"
47+
runner: matterlabs-ci-runner-arm
48+
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
49+
target: "aarch64-unknown-linux-musl"
5050
- name: "Windows"
5151
runner: windows-2022-github-hosted-16core
5252
runs-on: ${{ matrix.runner }}

src/tests/mod.rs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ pub fn build_solidity(
4646
let _ = crate::process::EXECUTABLE.set(PathBuf::from(crate::r#const::DEFAULT_EXECUTABLE_NAME));
4747

4848
let solc_compiler = SolcCompiler::new(
49-
format!("{}-{}", SolcCompiler::DEFAULT_EXECUTABLE_NAME, solc_version).as_str(),
49+
format!(
50+
"{}-{}{}",
51+
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
52+
solc_version,
53+
std::env::consts::EXE_SUFFIX,
54+
)
55+
.as_str(),
5056
)?;
5157

5258
let solc_input = SolcStandardJsonInput::try_from_solidity_sources(
@@ -132,7 +138,13 @@ pub fn build_solidity_and_detect_missing_libraries(
132138
let _ = crate::process::EXECUTABLE.set(PathBuf::from(crate::r#const::DEFAULT_EXECUTABLE_NAME));
133139

134140
let solc_compiler = SolcCompiler::new(
135-
format!("{}-{}", SolcCompiler::DEFAULT_EXECUTABLE_NAME, solc_version).as_str(),
141+
format!(
142+
"{}-{}{}",
143+
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
144+
solc_version,
145+
std::env::consts::EXE_SUFFIX,
146+
)
147+
.as_str(),
136148
)?;
137149

138150
let solc_input = SolcStandardJsonInput::try_from_solidity_sources(
@@ -375,7 +387,13 @@ pub fn check_solidity_message(
375387
check_dependencies(Some(solc_version));
376388

377389
let solc_compiler = SolcCompiler::new(
378-
format!("{}-{}", SolcCompiler::DEFAULT_EXECUTABLE_NAME, solc_version).as_str(),
390+
format!(
391+
"{}-{}{}",
392+
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
393+
solc_version,
394+
std::env::consts::EXE_SUFFIX,
395+
)
396+
.as_str(),
379397
)?;
380398
if skip_for_zksync_edition && solc_compiler.version.l2_revision.is_some() {
381399
return Ok(true);
@@ -425,9 +443,10 @@ fn check_dependencies(solc_version: Option<&semver::Version>) {
425443
let mut executables = vec![crate::r#const::DEFAULT_EXECUTABLE_NAME.to_owned()];
426444
if let Some(solc_version) = solc_version {
427445
executables.push(format!(
428-
"{}-{}",
446+
"{}-{}{}",
429447
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
430-
solc_version
448+
solc_version,
449+
std::env::consts::EXE_SUFFIX,
431450
));
432451
}
433452
for executable in executables.into_iter() {

src/tests/standard_json.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
#![cfg(test)]
66

7+
use std::env::consts::EXE_SUFFIX;
78
use std::path::PathBuf;
89

910
use crate::solc::standard_json::input::Input as SolcStandardJsonInput;
@@ -42,9 +43,10 @@ fn standard_json_yul_default_validated() {
4243
.expect("Standard JSON reading error");
4344
let solc_compiler = SolcCompiler::new(
4445
format!(
45-
"{}-{}",
46+
"{}-{}{}",
4647
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
47-
SolcCompiler::LAST_SUPPORTED_VERSION
48+
SolcCompiler::LAST_SUPPORTED_VERSION,
49+
EXE_SUFFIX
4850
)
4951
.as_str(),
5052
)
@@ -102,9 +104,10 @@ fn standard_json_yul_default_urls_validated() {
102104
.expect("Standard JSON reading error");
103105
let solc_compiler = SolcCompiler::new(
104106
format!(
105-
"{}-{}",
107+
"{}-{}{}",
106108
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
107-
SolcCompiler::LAST_SUPPORTED_VERSION
109+
SolcCompiler::LAST_SUPPORTED_VERSION,
110+
EXE_SUFFIX
108111
)
109112
.as_str(),
110113
)
@@ -162,9 +165,10 @@ fn standard_json_yul_eravm_validated() {
162165
.expect("Standard JSON reading error");
163166
let solc_compiler = SolcCompiler::new(
164167
format!(
165-
"{}-{}",
168+
"{}-{}{}",
166169
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
167-
SolcCompiler::LAST_SUPPORTED_VERSION
170+
SolcCompiler::LAST_SUPPORTED_VERSION,
171+
EXE_SUFFIX
168172
)
169173
.as_str(),
170174
)
@@ -222,9 +226,10 @@ fn standard_json_yul_eravm_urls_validated() {
222226
.expect("Standard JSON reading error");
223227
let solc_compiler = SolcCompiler::new(
224228
format!(
225-
"{}-{}",
229+
"{}-{}{}",
226230
SolcCompiler::DEFAULT_EXECUTABLE_NAME,
227-
SolcCompiler::LAST_SUPPORTED_VERSION
231+
SolcCompiler::LAST_SUPPORTED_VERSION,
232+
EXE_SUFFIX
228233
)
229234
.as_str(),
230235
)

0 commit comments

Comments
 (0)