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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ updates:
directories:
- "/"
- "/actions/**/*"
- "/tests/continuous-integration"
- "/tests/npm"
- "/tests/pnpm"
- "/tests/pnpm-package-manager"
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/__test-workflow-continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,82 @@ on:
permissions: {}

jobs:
act-without-build:
name: Act - Run contract tests without a build
uses: $/.github/workflows/continuous-integration.yml
permissions:
contents: read
id-token: write
packages: read
pull-requests: write
security-events: write
with:
working-directory: tests/continuous-integration
build: ""
lint: ""
code-ql: ""
dependency-review: false
test: '{"coverage":""}'

act-with-checks-disabled:
name: Act - Disable all application checks without starting a container
uses: $/.github/workflows/continuous-integration.yml
permissions:
contents: read
id-token: write
packages: read
pull-requests: write
security-events: write
with:
checks: false
container: invalid.example.invalid/must-not-be-pulled:latest
working-directory: /unmounted/application

assert-without-build:
name: Assert - Disabled builds produce no artifact
needs: [act-without-build, act-with-checks-disabled]
runs-on: ubuntu-latest
permissions: {}
steps:
- env:
BUILD_ARTIFACT: ${{ needs.act-without-build.outputs.build-artifact-id }}
DISABLED_ARTIFACT: ${{ needs.act-with-checks-disabled.outputs.build-artifact-id }}
run: |
test -z "$BUILD_ARTIFACT"
test -z "$DISABLED_ARTIFACT"

act-package-without-build:
name: Act - Validate a source package without a build
uses: $/.github/workflows/continuous-integration.yml
permissions:
contents: read
id-token: write
packages: read
pull-requests: write
security-events: write
with:
working-directory: tests/source-package
build: ""
lint: ""
test: ""
code-ql: ""
dependency-review: false
package: |
{"tests":"test -f \"$PACKAGE_INSTALL_PATH/index.cjs\""}

assert-package-without-build:
name: Assert - Packaging runs when compilation is omitted
needs: act-package-without-build
runs-on: ubuntu-latest
permissions: {}
steps:
- env:
PACKAGE_ARTIFACT: ${{ needs.act-package-without-build.outputs.package-tarball-artifact-id }}
BUILD_ARTIFACT: ${{ needs.act-package-without-build.outputs.build-artifact-id }}
run: |
test -n "$PACKAGE_ARTIFACT"
test -z "$BUILD_ARTIFACT"

package-configuration:
name: Assert - Package configuration
runs-on: ubuntu-latest
Expand Down Expand Up @@ -272,6 +348,24 @@ jobs:
test: |
{"coverage": "codecov"}

act-with-container-without-build:
name: Act - Run container checks without a build
uses: $/.github/workflows/continuous-integration.yml
needs: arrange-with-container
permissions:
contents: read
id-token: write
packages: read
pull-requests: write
security-events: write
with:
container: ${{ fromJSON(needs.arrange-with-container.outputs.built-images).ci-npm.images[0] }}
working-directory: /usr/src/app/
build: ""
code-ql: ""
dependency-review: false
test: '{"coverage":""}'

assert-with-container:
name: Assert - Ensure build artifact has been uploaded (with container)
runs-on: ubuntu-latest
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ jobs:
| | Explicit commands are unaffected. Does not apply in container mode, which skips installation. | | | |
| **`runs-on`** | JSON array of runner(s) to use. | **false** | **string** | `["ubuntu-latest"]` |
| | See <https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job>. | | | |
| **`build`** | Build parameters. Must be a string or a JSON object. | **false** | **string** | `build` |
| **`build`** | Build parameters. Accepts newline-separated commands, a JSON array, or a JSON object. | **false** | **string** | `build` |
| | An empty or whitespace-only string skips the build job; tests and optional packaging can run without it. | | | |
| | For string, provide a list of commands to run during the build step, one per line. | | | |
| | For JSON object, provide the following properties: | | | |
| | | | | |
Expand Down Expand Up @@ -325,7 +326,9 @@ jobs:
| | Example: | | | |
| | | | | |
| | <!-- textlint-disable --><pre lang="json:package.json">{&#13; "test:ci": "vitest run --reporter=default --reporter=junit --outputFile=junit.xml --coverage.enabled --coverage.reporter=lcov --coverage.reporter=text"&#13;}</pre><!-- textlint-enable --> | | | |
| **`working-directory`** | Working directory where the dependencies are installed. | **false** | **string** | `.` |
| **`working-directory`** | Working directory where dependencies and application commands run. | **false** | **string** | `.` |
| | Relative paths resolve against the workspace of each application job. | | | |
| | Directory existence and non-container workspace boundaries are validated in those jobs. | | | |
| **`container`** | Container configuration to run CI steps in. | **false** | **string** | - |
| | Accepts either a string (container image name) or a JSON object with container options. | | | |
| | | | | |
Expand Down
Loading
Loading