From 963e99be3d97b1f272c02184e1196542a18225af Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Fri, 15 Dec 2023 19:34:52 +0100 Subject: [PATCH] ci: split workflows (#357) have dedicated workflow for - generate the docs - tests with java - tests with php - test with javascript Signed-off-by: Jan Kowalleck --- .../workflows/{cibuild.yml => build_docs.yml} | 54 +++++++++++-------- .github/workflows/test_java.yml | 32 +++++++++++ .github/workflows/{js.yml => test_js.yml} | 3 +- .github/workflows/{php.yml => test_php.yml} | 6 ++- 4 files changed, 69 insertions(+), 26 deletions(-) rename .github/workflows/{cibuild.yml => build_docs.yml} (54%) create mode 100644 .github/workflows/test_java.yml rename .github/workflows/{js.yml => test_js.yml} (97%) rename .github/workflows/{php.yml => test_php.yml} (87%) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/build_docs.yml similarity index 54% rename from .github/workflows/cibuild.yml rename to .github/workflows/build_docs.yml index ceedac03..a1747b34 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/build_docs.yml @@ -1,4 +1,4 @@ -name: CI Build +name: Build Docs on: push: @@ -10,43 +10,51 @@ env: PYTHON_VERSION_DEFAULT: "3.10" jobs: - build: + docs_xml: runs-on: ubuntu-latest + defaults: + run: + working-directory: docgen/xml steps: - name: Checkout # see https://github.com/actions/checkout uses: actions/checkout@v4 - - name: Set up JDK - # see https://github.com/actions/setup-java - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'zulu' - java-package: jdk - - name: Build with Maven - run: mvn -B package --file pom.xml - working-directory: tools - name: Setup Python Environment # see https://github.com/actions/setup-python uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION_DEFAULT }} architecture: 'x64' - - name: Generate JSON Schema documentation - run: ./gen.sh - working-directory: docgen/json - - name: Generate XML Schema documentation + - name: Generate Schema documentation run: ./gen.sh - working-directory: docgen/xml - - name: Archive JSON Schema documentation + - name: Archive Schema documentation # https://github.com/actions/upload-artifact uses: actions/upload-artifact@v3 with: - name: JSON-Schema-documentation - path: docgen/json/docs - - name: Archive XML Schema documentation + name: XML-Schema-documentation + path: docgen/xml/docs + if-no-files-found: error + docs_json: + runs-on: ubuntu-latest + defaults: + run: + working-directory: docgen/json + steps: + - name: Checkout + # see https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Setup Python Environment + # see https://github.com/actions/setup-python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION_DEFAULT }} + architecture: 'x64' + - name: Generate Schema documentation + run: ./gen.sh + - name: Archive Schema documentation # https://github.com/actions/upload-artifact uses: actions/upload-artifact@v3 with: - name: XML-Schema-documentation - path: docgen/xml/docs + name: JSON-Schema-documentation + path: docgen/json/docs + if-no-files-found: error diff --git a/.github/workflows/test_java.yml b/.github/workflows/test_java.yml new file mode 100644 index 00000000..dfbcc784 --- /dev/null +++ b/.github/workflows/test_java.yml @@ -0,0 +1,32 @@ +name: CT Java + +on: + push: + branches: ['master', 'main'] + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + working-directory: tools + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + # see https://github.com/actions/checkout + uses: actions/checkout@v4 + - name: Set up JDK + # see https://github.com/actions/setup-java + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'zulu' + java-package: jdk + - name: test with Maven + run: mvn clean test diff --git a/.github/workflows/js.yml b/.github/workflows/test_js.yml similarity index 97% rename from .github/workflows/js.yml rename to .github/workflows/test_js.yml index 5e79d90a..4502b200 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/test_js.yml @@ -1,6 +1,6 @@ # docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -name: JS CI +name: CT JavaScript on: push: @@ -12,7 +12,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - defaults: run: working-directory: tools/src/test/js diff --git a/.github/workflows/php.yml b/.github/workflows/test_php.yml similarity index 87% rename from .github/workflows/php.yml rename to .github/workflows/test_php.yml index 3ee29466..498acebf 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/test_php.yml @@ -1,6 +1,6 @@ # docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions -name: PHP CI +name: CT PHP on: push: @@ -8,6 +8,10 @@ on: pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + defaults: run: working-directory: tools/src/test/php