This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Fix the broken downloading (hopefully) #23
Draft
xd009642
wants to merge
1
commit into
actions-rs:master
Choose a base branch
from
xd009642:fix/install
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ jobs: | |
uses: actions-rs/[email protected] | ||
with: | ||
version: '0.15.0' | ||
target: 'x86_64-unknown-linux-gnu' | ||
args: '-- --test-threads 1' | ||
|
||
- name: Upload to codecov.io | ||
|
@@ -52,6 +53,7 @@ See [additional recipes here](https://github.com/actions-rs/meta). | |
| Name | Required | Description | Type | Default | | ||
| ------------| :------: | ---------------------------------------------------------------------------------------------------------| ------ | --------| | ||
| `version` | | The version of `cargo-tarpaulin` that will be installed. | string | latest | | ||
| `target` | ✓ | The target to install tarpaulin for i.e. `x86_64-unknown-linux-gnu`. | string | latest | | ||
| `run-types` | | The type of tests to run (`Tests`, or `Doctests`). Runs all by default. May be overridden by `args`. | string | | | ||
| `timeout` | | The timeout, in seconds, before cancelling execution of a long running test. May be overriden by `args`. | string | | | ||
| `args` | | Extra command line arguments that are passed to `cargo-tarpaulin`. | string | | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ export default async function resolveConfig(input: ActionInputs): Promise<Tarpau | |
releaseEndpoint = process.env.GITHUB_RELEASE_ENDPOINT; | ||
} | ||
|
||
const downloadUrl = await getDownloadUrl(releaseEndpoint, input.requestedVersion); | ||
const downloadUrl = await getDownloadUrl(releaseEndpoint, input.target, input.requestedVersion); | ||
const type = input.runType ? input.runType : null; | ||
const timeout = input.timeout ? input.timeout : null; | ||
const outType = input.outType ? input.outType : "Xml"; | ||
|
@@ -71,19 +71,20 @@ export default async function resolveConfig(input: ActionInputs): Promise<Tarpau | |
* @param requestedVersion The Git tag of the tarpaulin revision to get a download URL for. May be any valid Git tag, | ||
* or a special-cased `latest`. | ||
*/ | ||
async function getDownloadUrl(releaseEndpoint: string, requestedVersion: string): Promise<string> { | ||
async function getDownloadUrl(releaseEndpoint: string, target: String, requestedVersion: string): Promise<string> { | ||
const releaseInfoUri = requestedVersion === 'latest' ? | ||
`${releaseEndpoint}/latest` : | ||
`${releaseEndpoint}/tags/${requestedVersion}`; | ||
|
||
const releaseInfoRequest = await fetch(releaseInfoUri); | ||
const releaseInfo = await releaseInfoRequest.json(); | ||
const asset = releaseInfo["assets"].find(asset => { | ||
return asset['content_type'] === 'application/gzip'; | ||
|
||
const asset = releaseInfo["name"].find(asset => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should still refer to |
||
return asset['name'].startsWith(`cargo-tarpaulin-${target}`) | ||
}); | ||
|
||
if (!asset) { | ||
throw new Error(`Couldn't find a release tarball containing binaries for ${requestedVersion}`); | ||
throw new Error(`Couldn't find ${requestedVersion} release tarball containing ${target} binaries`); | ||
} | ||
|
||
return asset["browser_download_url"]; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably shouldn't include the
Default
field here (leaving it empty instead).