mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 03:39:08 +08:00
Test matrix strategy
This commit is contained in:
parent
6b96da32ae
commit
e1f6cb00bd
28
.github/workflows/artifact-tests.yml
vendored
28
.github/workflows/artifact-tests.yml
vendored
@ -77,3 +77,31 @@ jobs:
|
||||
console.log(`Successfully uploaded artifact ${id}`)
|
||||
}
|
||||
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-ubuntu-latest, build-windows-latest, build-macos-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
|
||||
# without these to just compile the artifacts package
|
||||
- name: Install root npm packages
|
||||
run: npm ci
|
||||
|
||||
- name: Compile artifact package
|
||||
run: |
|
||||
npm ci
|
||||
npm run tsc
|
||||
working-directory: packages/artifact
|
||||
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
console.log('we're going to call list from here')
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {warning} from '@actions/core'
|
||||
import {info, warning, debug} from '@actions/core'
|
||||
import {getOctokit} from '@actions/github'
|
||||
import {ListArtifactsResponse, Artifact} from '../shared/interfaces'
|
||||
import {getUserAgentString} from '../shared/user-agent'
|
||||
@ -29,6 +29,8 @@ export async function listArtifacts(
|
||||
repositoryName: string,
|
||||
token: string
|
||||
): Promise<ListArtifactsResponse> {
|
||||
info(`Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}\\${repositoryName}`)
|
||||
|
||||
const artifacts: Artifact[] = []
|
||||
const [retryOpts, requestOpts] = getRetryOptions(
|
||||
maxRetryNumber,
|
||||
@ -77,12 +79,15 @@ export async function listArtifacts(
|
||||
})
|
||||
})
|
||||
|
||||
// Iterate over any remaining pages
|
||||
for (
|
||||
currentPageNumber;
|
||||
currentPageNumber < numberOfPages;
|
||||
currentPageNumber++
|
||||
) {
|
||||
currentPageNumber++
|
||||
debug(`Fetching page ${currentPageNumber} of artifact list`)
|
||||
|
||||
const {data: listArtifactResponse} =
|
||||
await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: repositoryOwner,
|
||||
@ -102,6 +107,8 @@ export async function listArtifacts(
|
||||
})
|
||||
}
|
||||
|
||||
info(`Finished fetching artifact list`)
|
||||
|
||||
return {
|
||||
artifacts: artifacts
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user