Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
test:
runs-on: ubuntu-latest
name: test-all # PRs can require just this job to pass, regardless of matrix changes below
needs: [check_dist, test_matrix, test_multi]
needs: [check_dist, test_matrix, test_multi, test_repeated]
steps:
- run: echo "Test-matrix successful" # anything with zero exit code

Expand Down Expand Up @@ -81,3 +81,36 @@ jobs:
solc --version | grep 0.8.30;
solc-v0.8.30 --version | grep 0.8.30;
solc-v0.8.29 --version | grep 0.8.29;

test_repeated:
needs: check_dist
name: setup-solc-again
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Initial
uses: ./
with:
version: 0.8.30
versions: '0.8.30,0.8.29'

- name: Check initial version
run: |
solc --version | grep 0.8.30;
solc-v0.8.30 --version | grep 0.8.30;
solc-v0.8.29 --version | grep 0.8.29;

- name: Re-installation
uses: ./
with:
version: 0.8.29
# Check that solc-v0.8.30 existence doesn't cause an error, and that
# solc-v0.8.29 isn't removed despite not being specified.
versions: '0.8.30'

- name: Check re-installed version
run: |
solc --version | grep 0.8.29;
solc-v0.8.30 --version | grep 0.8.30;
solc-v0.8.29 --version | grep 0.8.29;
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29846,8 +29846,12 @@ try {
throw Error(`Version ${version} not found`);
}
const downloaded = await toolCacheExports.downloadTool(constructURL(build.path));
await fs.chmod(downloaded, 0o555);
await Promise.all(outs.map((out) => fs.copyFile(downloaded, path.join(destDir, out))));
await Promise.all(outs.map(async (out) => {
const dest = path.join(destDir, out);
await fs.rm(dest, { force: true }); // allow multiple invocations
await fs.copyFile(downloaded, dest);
await fs.chmod(dest, 0o555);
}));
console.info(`${version} at ${outs}`);
}
;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ try {
}

const downloaded = await tc.downloadTool(constructURL(build.path));
await fs.chmod(downloaded, 0o555);

await Promise.all(
outs.map((out) => fs.copyFile(
downloaded,
path.join(destDir, out)
))
outs.map(async (out) => {
const dest = path.join(destDir, out);
await fs.rm(dest, { force: true }); // allow multiple invocations
await fs.copyFile(downloaded, dest);
await fs.chmod(dest, 0o555);
})
);
console.info(`${version} at ${outs}`);
};
Expand Down
Loading