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
42 changes: 42 additions & 0 deletions .github/workflows/discover_2.x_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: Discover CDX-2.x Schema

on:
workflow_call:
outputs:
versions:
description: 'JSON array of discovered versions'
value: ${{ jobs.discover.outputs.versions }}

# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}

jobs:
discover:
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.discover.outputs.versions }}
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Discover schema versions
id: discover
run: |
mapfile -d '' -t dirs < <(
find schema \
-mindepth 1 -maxdepth 1 \
-type d \
-name '2.*' \
-printf '%f\0' \
| sort -z
)
if [ ${#dirs[@]} -eq 0 ]; then
echo 'No schema/2.* directories found' >&2
exit 1
fi
printf 'versions=' >> "$GITHUB_OUTPUT"
printf '%s\n' "${dirs[@]}" | jq -R . | jq -c -s . >> "$GITHUB_OUTPUT"
28 changes: 1 addition & 27 deletions .github/workflows/lint_2.x_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,7 @@ env:

jobs:
discover-schema:
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.discover.outputs.versions }}
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Discover schema versions
id: discover
run: |
mapfile -d '' -t dirs < <(
find schema \
-mindepth 1 -maxdepth 1 \
-type d \
-name '2.*' \
-printf '%f\0' \
| sort -z
)
if [ ${#dirs[@]} -eq 0 ]; then
echo 'No schema/2.* directories found' >&2
exit 1
fi
printf 'versions=' >> "$GITHUB_OUTPUT"
printf '%s\n' "${dirs[@]}" | jq -R . | jq -c -s . >> "$GITHUB_OUTPUT"
uses: ./.github/workflows/discover_2.x_schema.yml
discover-linter:
timeout-minutes: 5
runs-on: ubuntu-latest
Expand Down
32 changes: 27 additions & 5 deletions .github/workflows/test_2.x_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,30 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}

defaults:
run:
working-directory: tools

# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}
env:
JAVA_VERSION: '8'
JAVA_DISTRIBUTION: 'zulu'

jobs:
discover-schema:
uses: ./.github/workflows/discover_2.x_schema.yml
test_java:
needs:
- discover-schema
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
schema_version: ${{ fromJSON(needs.discover-schema.outputs.versions) }}
name: test ${{ matrix.schema_version }}
steps:
- name: Checkout
# see https://github.com/actions/checkout
Expand All @@ -30,8 +44,16 @@ jobs:
# see https://github.com/actions/setup-java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
java-version: '8'
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-package: jdk
- name: test with Maven
run: mvn clean test -Pschema-v2-tests
env:
SCHEMA_VERSION: ${{ matrix.schema_version }}
run: >-
mvn clean test
-D "surefire.includeTags=schema-v${SCHEMA_VERSION}"
-D failIfNoTests=true
- name: Print report
if: ${{ failure() }}
run: cat ./target/surefire-reports/*
22 changes: 18 additions & 4 deletions .github/workflows/test_2.x_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,30 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}

defaults:
run:
working-directory: tools/src/test/js/schema-v2

# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}
env:
NODE_VERSION: '24.x'

jobs:
discover-schema:
uses: ./.github/workflows/discover_2.x_schema.yml
test_js:
needs:
- discover-schema
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
schema_version: ${{ fromJSON(needs.discover-schema.outputs.versions) }}
name: test ${{ matrix.schema_version }}
steps:
- name: Checkout
# see https://github.com/actions/checkout
Expand All @@ -33,7 +46,7 @@ jobs:
# see https://github.com/actions/setup-node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.x'
node-version: ${{ env.NODE_VERSION }}
package-manager-cache: false
- name: Install Dependencies
run: npm install
Expand All @@ -47,4 +60,5 @@ jobs:
&& github.base_ref == 'master'
)
}}
run: npm test
SCHEMA_VERSION: ${{ matrix.schema_version }}
run: npm run "test:v$SCHEMA_VERSION"
23 changes: 19 additions & 4 deletions .github/workflows/test_2.x_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,30 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}

defaults:
run:
working-directory: tools/src/test/php/schema-v2

# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}
env:
PHP_VERSION: "8.5"

jobs:
discover-schema:
uses: ./.github/workflows/discover_2.x_schema.yml
test_php:
needs:
- discover-schema
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
schema_version: ${{ fromJSON(needs.discover-schema.outputs.versions) }}
name: test ${{ matrix.schema_version }}
steps:
- name: Checkout
# see https://github.com/actions/checkout
Expand All @@ -33,9 +46,11 @@ jobs:
# see https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: "8.5"
php-version: ${{ env.PHP_VERSION }}
tools: composer:v2
- name: Install Dependencies
run: composer install
- name: Run test
run: composer run test
env:
SCHEMA_VERSION: ${{ matrix.schema_version }}
run: composer run "test:v$SCHEMA_VERSION"
25 changes: 24 additions & 1 deletion tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<!-- Test tag filtering: empty = run all tests.
Overridden by profiles or via -Dsurefire.includeTags=... -->
<surefire.includeTags></surefire.includeTags>
<!-- Print test run output (System.out/logging of tests) to the console instead of report files.
Set to true to write to target/surefire-reports/*.txt instead. -->
<surefire.useFile>false</surefire.useFile>
<!-- Maven Plugin Versions -->
<maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
<maven.source.plugin.version>3.0.1</maven.source.plugin.version>
Expand Down Expand Up @@ -179,6 +182,20 @@
<version>3.5.2</version>
<configuration>
<groups>${surefire.includeTags}</groups>
<useFile>${surefire.useFile}</useFile>
<!-- Use JUnit display names (e.g. the schema test-data resource path)
instead of technical names like verifyTestData()[7] -->
<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
<usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
</statelessTestsetReporter>
<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoReporter">
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedClassNameInRunning>true</usePhrasedClassNameInRunning>
<usePhrasedClassNameInTestCaseSummary>true</usePhrasedClassNameInTestCaseSummary>
</statelessTestsetInfoReporter>
</configuration>
</plugin>
</plugins>
Expand All @@ -205,5 +222,11 @@
<surefire.includeTags>schema-v2</surefire.includeTags>
</properties>
</profile>
<profile>
<id>schema-v2.0-tests</id>
<properties>
<surefire.includeTags>schema-v2.0</surefire.includeTags>
</properties>
</profile>
</profiles>
</project>
</project>
Loading
Loading