diff --git a/.github/workflows/__test-workflow-continuous-integration.yml b/.github/workflows/__test-workflow-continuous-integration.yml index 7d6200a..66e0506 100644 --- a/.github/workflows/__test-workflow-continuous-integration.yml +++ b/.github/workflows/__test-workflow-continuous-integration.yml @@ -10,5 +10,25 @@ permissions: id-token: write jobs: - tests: + act: + name: Act - Run the continuous integration workflow uses: ./.github/workflows/continuous-integration.yml + with: + build: | + { + "artifact": "dist" + } + + assert: + name: Assert - Ensure build artifact has been uploaded + runs-on: ubuntu-latest + needs: act + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: build + path: "/" + + - name: Check the build artifacts + run: test -f dist/index.html diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 65e29cd..c02de62 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -114,18 +114,11 @@ jobs: .map(artifact => artifact.trim()) .filter(Boolean) .map(artifact => { - if (!artifact.includes('*')) { - if (artifact.startsWith('/')) { - return artifact; - } - - return `${{ github.workspace }}/${artifact}`; - } - // FIXME: Workaround to preserve full path to artifact + const fullpath = artifact.startsWith('/') ? artifact : `${{ github.workspace }}/${artifact}`; + // Add a wildcard to the first folder of the path - const workspace = `${{ github.workspace }}`.replace(/\/([^/]+)/, '/*$1'); - return `${workspace}/${artifact}`; + return fullpath.replace(/\/([^/]+)/, '/*$1'); }); core.setOutput('artifact', sanitizedArtifacts.join('\n')); diff --git a/.gitignore b/.gitignore index 30bc162..b2d59d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/node_modules \ No newline at end of file +/node_modules +/dist \ No newline at end of file diff --git a/package.json b/package.json index 36297c0..7d7ffdc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "test-for-ci", "scripts": { "lint": "echo \"lint test\"", - "build": "echo \"build test\"", + "build": "mkdir -p dist && echo \"build test\" > dist/test.txt", "test:ci": "echo \"test CI\"" }, "dependencies": {