From 5a6b18582888ec9277ed4c661710353cb603d8cd Mon Sep 17 00:00:00 2001 From: BereKanters Date: Tue, 11 Jun 2024 13:22:39 +0200 Subject: [PATCH 01/19] ###feature/Integrate random matrix generation and merge Ubuntu and Windows workflows - Added a new CI workflow using vlsi/github-actions-random-matrix to generate a dynamic matrix for testing on both Ubuntu and Windows with JDK 8 and JDK 11. - Merged existing build steps for Ubuntu and Windows into a single workflow file (ci.yml). - Moved common steps, such as caching the Android jar and compiling, into a separate setup job to improve CI efficiency. - Updated README.md to reflect the new combined CI workflow badge. - Improved test coverage and reduced CI resource usage by leveraging the matrix strategy. --- .github/workflows/ci.yml | 115 +++++++++++++++++++++++++++++++++++++++ README.md | 3 +- 2 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..4785b82986 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,115 @@ +name: CI + +on: [ push, pull_request ] + +jobs: + # Job to generate the matrix + generate-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate matrix + id: set-matrix + uses: vlsi/github-actions-random-matrix@v1 + with: + include: | + [ + {"os": "ubuntu-latest", "java_version": "11"}, + {"os": "ubuntu-latest", "java_version": "17"}, + {"os": "windows-latest", "java_version": "11"}, + {"os": "windows-latest", "java_version": "17"} + ] + + # Setup job to run common steps + setup: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache Android jar + id: android-cache + uses: actions/cache@v4 + with: + path: android-jar-cache + key: ${{ runner.os }}-android-version-26 + + - name: Download Android SDK's android.jar (or use cached file) + if: steps.android-cache.outputs.cache-hit != 'true' + run: | + mkdir android-jar-cache + cd android-jar-cache + curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" + echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 + if ! sha256sum -c android.sha256; then + echo >&2 "wrong sha256 for android.jar, expected:" + cat >&2 android.sha256 + echo >&2 "actual:" + sha256sum android.jar + exit 1; + fi + + # Main build and test job using the generated matrix + build-and-test: + needs: [generate-matrix, setup] + runs-on: ${{ matrix.os }} + strategy: + matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: ${{ matrix.java_version }} + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3.3.2 + + - name: Build using JDK ${{ matrix.java_version }} + run: ./gradlew build + + - name: Upload build code coverage + uses: codecov/codecov-action@v4.4.1 + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: ${{ matrix.os == 'windows-latest' && 'current_windows' || 'current' }} + env_vars: JAVA_VERSION + + - name: Check Atrium's -jvm.jar can be dexed + run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer + + - name: Composite build atrium-samples-test + run: ./gradlew build + working-directory: misc/tools/atrium-samples-test + + forwardCompatibility: + needs: setup + env: + JAVA_VERSION: 17 + KOTLIN_VERSION: ${{ matrix.kotlin_version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: 17 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3.3.2 + + - name: Build using Kotlin ${{ matrix.kotlin_version }} + run: ./gradlew build diff --git a/README.md b/README.md index 476f74c9a8..4cf431630c 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ [![Download](https://img.shields.io/badge/Download-1.2.0-%23007ec6)](https://central.sonatype.com/artifact/ch.tutteli.atrium/atrium-fluent/1.2.0) [![EUPL](https://img.shields.io/badge/%E2%9A%96-EUPL%201.2-%230b45a6)](https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12 "License") [![atrium @ kotlinlang.slack.com](https://img.shields.io/static/v1?label=kotlinlang&message=atrium&color=blue&logo=slack)](https://kotlinlang.slack.com/messages/atrium "See invitation link under section FAQ") -[![Build Status Ubuntu](https://github.com/robstoll/atrium/workflows/Ubuntu/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3AUbuntu+branch%3Amain) -[![Build Status Windows](https://github.com/robstoll/atrium/workflows/Windows/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3AWindows+branch%3Amain) +[![Build Status](https://github.com/robstoll/atrium/actions/workflows/ci.yml/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3Aci.yml+branch%3Amain) [![Coverage](https://codecov.io/gh/robstoll/atrium/branch/main/graph/badge.svg)](https://app.codecov.io/github/robstoll/atrium/branch/main) [![Newcomers Welcome](https://img.shields.io/badge/%F0%9F%91%8B-Newcomers%20Welcome-blueviolet)](https://github.com/robstoll/atrium/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 "Ask in slack for help") From 076c1361f13a033027f670d2a2b78589a4906c46 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Wed, 12 Jun 2024 11:39:03 +0200 Subject: [PATCH 02/19] ###feature/Added feature-random-matrix-ci.patch file - Added a new patch file --- feature-random-matrix-ci.patch | Bin 0 -> 13280 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 feature-random-matrix-ci.patch diff --git a/feature-random-matrix-ci.patch b/feature-random-matrix-ci.patch new file mode 100644 index 0000000000000000000000000000000000000000..80aa9a0f1efcaa92cd92c2bcac3216d70206a0e4 GIT binary patch literal 13280 zcmdU$X>%0E8OQr|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b0ad5fb660b9378a74 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 09:58:58 +0000 Subject: [PATCH 03/19] chore(deps): update codecov/codecov-action action to v4.5.0 --- .github/workflows/build-ubuntu.yml | 2 +- .github/workflows/build-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 14b1c8950a..e4c806facb 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -27,7 +27,7 @@ jobs: run: ./gradlew build - name: Upload build code coverage - uses: codecov/codecov-action@v4.4.1 + uses: codecov/codecov-action@v4.5.0 if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} with: diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 7552cdc990..36e1e4de70 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -26,7 +26,7 @@ jobs: run: ./gradlew build - name: Upload windows build code coverage - uses: codecov/codecov-action@v4.4.1 + uses: codecov/codecov-action@v4.5.0 if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} with: token: ${{ secrets.CODECOV_TOKEN }} From 838adff5a5802b1f698ea8b59250bccb16507e31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:18:55 +0000 Subject: [PATCH 04/19] chore(deps): update gradle/gradle-build-action action to v3.4.0 --- .github/workflows/build-ubuntu.yml | 4 ++-- .github/workflows/build-windows.yml | 2 +- .github/workflows/check-generated-committed.yml | 2 +- .github/workflows/generate-readme-examples.yml | 2 +- .github/workflows/samples-windows.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index e4c806facb..46556fc728 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -21,7 +21,7 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.0 - name: "build using jdk ${{ matrix.java_version }}" run: ./gradlew build @@ -94,7 +94,7 @@ jobs: distribution: 'adopt' java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.0 - name: "build using kotlin ${{ matrix.kotlin_version }}" run: ./gradlew build diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 36e1e4de70..f46df07bb0 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -20,7 +20,7 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.0 - name: "build using jdk ${{ matrix.java_version }}" run: ./gradlew build diff --git a/.github/workflows/check-generated-committed.yml b/.github/workflows/check-generated-committed.yml index 01988c265d..7f0c0fb795 100644 --- a/.github/workflows/check-generated-committed.yml +++ b/.github/workflows/check-generated-committed.yml @@ -19,7 +19,7 @@ jobs: distribution: 'adopt' java-version: 11 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.0 - name: check generateLogic committed run: ./gradle/scripts/check-generateLogic-committed.sh shell: bash diff --git a/.github/workflows/generate-readme-examples.yml b/.github/workflows/generate-readme-examples.yml index e1eeacf7c5..98c9b1fb9f 100644 --- a/.github/workflows/generate-readme-examples.yml +++ b/.github/workflows/generate-readme-examples.yml @@ -15,7 +15,7 @@ jobs: distribution: 'adopt' java-version: 11 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.0 - name: Generate readme run: ./gradlew :readme-examples:build diff --git a/.github/workflows/samples-windows.yml b/.github/workflows/samples-windows.yml index b0a810bb0d..7f233e7cea 100644 --- a/.github/workflows/samples-windows.yml +++ b/.github/workflows/samples-windows.yml @@ -25,7 +25,7 @@ jobs: java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.0 - name: Cache maven dependencies uses: actions/cache@v4 From 2f35e51a42118ae4959c73376ea3a19b69398840 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Fri, 14 Jun 2024 22:28:42 +0200 Subject: [PATCH 05/19] ###feat/Integrate custom random matrix generation and merge Ubuntu and Windows workflows updated based on feedback - Added custom matrix generation scripts (`matrix_builder.js` and `matrix.js`) to dynamically generate the matrix for CI jobs. - Configured the GitHub Actions workflow (`ci.yml`) to use the custom matrix generator. - Renamed the `setup` job to `dexer` and included the step to check if Atrium's -jvm.jar can be dexed. --- .github/workflows/ci.yml | 88 +++++------ .github/workflows/matrix.js | 29 ++++ .github/workflows/matrix_builder.js | 236 ++++++++++++++++++++++++++++ 3 files changed, 306 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/matrix.js create mode 100644 .github/workflows/matrix_builder.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4785b82986..0cee643fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,8 @@ name: CI -on: [ push, pull_request ] +on: [push, pull_request] jobs: - # Job to generate the matrix generate-matrix: runs-on: ubuntu-latest outputs: @@ -12,50 +11,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Generate matrix - id: set-matrix - uses: vlsi/github-actions-random-matrix@v1 - with: - include: | - [ - {"os": "ubuntu-latest", "java_version": "11"}, - {"os": "ubuntu-latest", "java_version": "17"}, - {"os": "windows-latest", "java_version": "11"}, - {"os": "windows-latest", "java_version": "17"} - ] - - # Setup job to run common steps - setup: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache Android jar - id: android-cache - uses: actions/cache@v4 + - name: Set up Node.js + uses: actions/setup-node@v2 with: - path: android-jar-cache - key: ${{ runner.os }}-android-version-26 + node-version: '14' - - name: Download Android SDK's android.jar (or use cached file) - if: steps.android-cache.outputs.cache-hit != 'true' - run: | - mkdir android-jar-cache - cd android-jar-cache - curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" - echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 - if ! sha256sum -c android.sha256; then - echo >&2 "wrong sha256 for android.jar, expected:" - cat >&2 android.sha256 - echo >&2 "actual:" - sha256sum android.jar - exit 1; - fi + - name: Generate matrix + id: set-matrix + run: node .github/workflows/matrix.js - # Main build and test job using the generated matrix build-and-test: - needs: [generate-matrix, setup] + needs: generate-matrix runs-on: ${{ matrix.os }} strategy: matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} @@ -83,15 +49,43 @@ jobs: flags: ${{ matrix.os == 'windows-latest' && 'current_windows' || 'current' }} env_vars: JAVA_VERSION - - name: Check Atrium's -jvm.jar can be dexed - run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer - - name: Composite build atrium-samples-test run: ./gradlew build working-directory: misc/tools/atrium-samples-test + dexer: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache Android jar + id: android-cache + uses: actions/cache@v4 + with: + path: android-jar-cache + key: ${{ runner.os }}-android-version-26 + + - name: Download Android SDK's android.jar (or use cached file) + if: steps.android-cache.outputs.cache-hit != 'true' + run: | + mkdir android-jar-cache + cd android-jar-cache + curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" + echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 + if ! sha256sum -c android.sha256; then + echo >&2 "wrong sha256 for android.jar, expected:" + cat >&2 android.sha256 + echo >&2 "actual:" + sha256sum android.jar + exit 1; + fi + + - name: Check Atrium's -jvm.jar can be dexed + run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer + forwardCompatibility: - needs: setup + needs: dexer env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} @@ -99,7 +93,7 @@ jobs: strategy: fail-fast: false matrix: - kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] + kotlin_version: ['1.5', '1.6', '1.7', '1.8', '1.9', '2.0'] steps: - uses: actions/checkout@v4 - name: Set up JDK 17 diff --git a/.github/workflows/matrix.js b/.github/workflows/matrix.js new file mode 100644 index 0000000000..21f414c3b9 --- /dev/null +++ b/.github/workflows/matrix.js @@ -0,0 +1,29 @@ +let { MatrixBuilder } = require('./matrix_builder'); +const matrix = new MatrixBuilder(); + +// Add axes for the matrix +matrix.addAxis({ + name: 'os', + title: x => x.replace('-latest', ''), + values: ['ubuntu-latest', 'windows-latest'] +}); +matrix.addAxis({ + name: 'java_version', + values: ['11', '17'] +}); + +// Ensure at least one windows and at least one linux job is present (macos is almost the same as linux) +matrix.generateRow({ os: 'windows-latest' }); +matrix.generateRow({ os: 'ubuntu-latest' }); + +// Generate more rows, no duplicates would be generated +const include = matrix.generateRows(process.env.MATRIX_JOBS || 5); +if (include.length === 0) { + throw new Error('Matrix list is empty'); +} +// Sort jobs by name, however, numeric parts are sorted appropriately +// For instance, 'windows 8' would come before 'windows 11' +include.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true })); + +console.log(include); +console.log('::set-output name=matrix::' + JSON.stringify({ include })); diff --git a/.github/workflows/matrix_builder.js b/.github/workflows/matrix_builder.js new file mode 100644 index 0000000000..4cf2b8e5cb --- /dev/null +++ b/.github/workflows/matrix_builder.js @@ -0,0 +1,236 @@ +// License: Apache-2.0 +// Copyright Vladimir Sitnikov, 2021 +// See https://github.com/vlsi/github-actions-random-matrix + +class Axis { + constructor({name, title, values}) { + this.name = name; + this.title = title; + this.values = values; + // If all entries have same weight, the axis has uniform distribution + this.uniform = values.reduce((a, b) => a === (b.weight || 1) ? a : 0, values[0].weight || 1) !== 0 + this.totalWeight = this.uniform ? values.length : values.reduce((a, b) => a + (b.weight || 1), 0); + } + + static matches(row, filter) { + if (typeof filter === 'function') { + return filter(row); + } + if (Array.isArray(filter)) { + // e.g. row={os: 'windows'}; filter=[{os: 'linux'}, {os: 'linux'}] + return filter.find(v => Axis.matches(row, v)); + } + if (typeof filter === 'object') { + // e.g. row={jdk: {name: 'openjdk', version: 8}}; filter={jdk: {version: 8}} + for (const [key, value] of Object.entries(filter)) { + if (!row.hasOwnProperty(key) || !Axis.matches(row[key], value)) { + return false; + } + } + return true; + } + return row === filter; + } + + pickValue(filter) { + let values = this.values; + if (filter) { + values = values.filter(v => Axis.matches(v, filter)); + } + if (values.length === 0) { + const filterStr = typeof filter === 'string' ? filter.toString() : JSON.stringify(filter); + throw Error(`No values produces for axis '${this.name}' from ${JSON.stringify(this.values)}, filter=${filterStr}`); + } + if (values.length === 1) { + return values[0]; + } + if (this.uniform) { + return values[Math.floor(Math.random() * values.length)]; + } + const totalWeight = !filter ? this.totalWeight : values.reduce((a, b) => a + (b.weight || 1), 0); + let weight = Math.random() * totalWeight; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + weight -= value.weight || 1; + if (weight <= 0) { + return value; + } + } + return values[values.length - 1]; + } +} + +class MatrixBuilder { + constructor() { + this.axes = []; + this.axisByName = {}; + this.rows = []; + this.duplicates = {}; + this.excludes = []; + this.includes = []; + this.failOnUnsatisfiableFilters = false; + } + + /** + * Specifies include filter (all the generated rows would comply with all the include filters) + * @param filter + */ + include(filter) { + this.includes.push(filter); + } + + /** + * Specifies exclude filter (e.g. exclude a forbidden combination) + * @param filter + */ + exclude(filter) { + this.excludes.push(filter); + } + + addAxis({name, title, values}) { + const axis = new Axis({name, title, values}); + this.axes.push(axis); + this.axisByName[name] = axis; + return axis; + } + + setNamePattern(names) { + this.namePattern = names; + } + + /** + * Returns true if the row matches the include and exclude filters. + * @param row input row + * @returns {boolean} + */ + matches(row) { + return (this.excludes.length === 0 || !this.excludes.find(f => Axis.matches(row, f))) && + (this.includes.length === 0 || this.includes.find(f => Axis.matches(row, f))); + } + + failOnUnsatisfiableFilters(value) { + this.failOnUnsatisfiableFilters = value; + } + + /** + * Adds a row that matches the given filter to the resulting matrix. + * filter values could be + * - literal values: filter={os: 'windows-latest'} + * - arrays: filter={os: ['windows-latest', 'linux-latest']} + * - functions: filter={os: x => x!='windows-latest'} + * @param filter object with keys matching axes names + * @returns {*} + */ + generateRow(filter) { + let res; + if (filter) { + // If matching row already exists, no need to generate more + res = this.rows.find(v => Axis.matches(v, filter)); + if (res) { + return res; + } + } + for (let i = 0; i < 142; i++) { + res = this.axes.reduce( + (prev, next) => + Object.assign(prev, { + [next.name]: next.pickValue(filter ? filter[next.name] : undefined) + }), + {} + ); + if (!this.matches(res)) { + continue; + } + const key = JSON.stringify(res); + if (!this.duplicates.hasOwnProperty(key)) { + this.duplicates[key] = true; + res.name = + this.namePattern.map(axisName => { + let value = res[axisName]; + const title = value.title; + if (typeof title != 'undefined') { + return title; + } + const computeTitle = this.axisByName[axisName].title; + return computeTitle ? computeTitle(value) : value; + }).filter(Boolean).join(", "); + this.rows.push(res); + return res; + } + } + const filterStr = typeof filter === 'string' ? filter.toString() : JSON.stringify(filter); + const msg = `Unable to generate row for ${filterStr}. Please check include and exclude filters`; + if (this.failOnUnsatisfiableFilters) { + throw Error(msg); + } else { + console.warn(msg); + } + } + + generateRows(maxRows, filter) { + for (let i = 0; this.rows.length < maxRows && i < maxRows; i++) { + this.generateRow(filter); + } + return this.rows; + } + + /** + * Computes the number of all the possible combinations. + * @returns {{bad: number, good: number}} + */ + summary() { + let position = -1; + let indices = []; + let values = {}; + const axes = this.axes; + function resetValuesUpTo(nextPosition) { + for(let i=0; i Date: Sat, 15 Jun 2024 01:04:17 +0200 Subject: [PATCH 06/19] ###feat/Changed custom random matrix generation and merge Ubuntu and Windows workflows based on given feedback - Updated the `forwardCompatibility` job to run in parallel with `dexer` by removing the unnecessary dependency. - Added `fetch-depth: 1` to all checkout steps for faster execution. - Removed unnecessary Node.js setup step since Node.js is pre-installed on the runner. - Updated the README file to reflect the new combined CI workflow badge. - Removed patch file --- .github/workflows/build-ubuntu.yml | 100 ------------------ .github/workflows/build-windows.yml | 50 --------- .../{ci.yml => quality-assurance.yml} | 23 ++-- README.md | 2 +- feature-random-matrix-ci.patch | Bin 13280 -> 0 bytes 5 files changed, 13 insertions(+), 162 deletions(-) delete mode 100644 .github/workflows/build-ubuntu.yml delete mode 100644 .github/workflows/build-windows.yml rename .github/workflows/{ci.yml => quality-assurance.yml} (86%) delete mode 100644 feature-random-matrix-ci.patch diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml deleted file mode 100644 index 14b1c8950a..0000000000 --- a/.github/workflows/build-ubuntu.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Ubuntu - -on: [ push, pull_request ] - -jobs: - build: - env: - android-version: 26 - JAVA_VERSION: ${{ matrix.java_version }} - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - java_version: [ 11, 17 ] - - steps: - - uses: actions/checkout@v4 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: ${{ matrix.java_version }} - - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 - - - name: "build using jdk ${{ matrix.java_version }}" - run: ./gradlew build - - - name: Upload build code coverage - uses: codecov/codecov-action@v4.4.1 - if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} - - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: current - env_vars: JAVA_VERSION - # too many timeout errors, let's not fail at the moment - #fail_ci_if_error: true - - - name: Cache android jar - id: android-cache - uses: actions/cache@v4 - with: - path: android-jar-cache - key: ${{ runner.os }}-android-version-${{ env.android-version }} - - - name: download Android SDK's android.jar (or use cached file) - if: steps.android-cache.outputs.cache-hit != 'true' - run: | - mkdir android-jar-cache - cd android-jar-cache - curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-${{ env.android-version }}/android.jar?raw=true" - echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" >android.sha256 - if ! sha256sum -c android.sha256; then - echo >&2 "wrong sha256 for android.jar, expected:" - cat >&2 android.sha256 - echo >&2 "actual:" - sha256sum android.jar - exit 1; - fi - - - name: check Atrium's -jvm.jar can be dexed - run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer - - # TODO 3.0.0 re-activate scala API - # - name: composite build atrium-scala2 - # run: ./gradlew build - # working-directory: misc/tools/atrium-scala2-test - - - - name: composite build atrium-samples-test - run: ./gradlew build - working-directory: misc/tools/atrium-samples-test - - # TODO 1.3.0 activate again once we use JS IR - # - name: composite build atrium-js-sample-test - # run: ./gradlew build - # working-directory: misc/tools/atrium-js-sample-test - - forwardCompatibility: - env: - JAVA_VERSION: 17 - KOTLIN_VERSION: ${{ matrix.kotlin_version }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] - steps: - - uses: actions/checkout@v4 - - name: "Set up JDK 17" - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: 17 - - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 - - - name: "build using kotlin ${{ matrix.kotlin_version }}" - run: ./gradlew build diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml deleted file mode 100644 index 7552cdc990..0000000000 --- a/.github/workflows/build-windows.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Windows - -on: [ push, pull_request ] - -jobs: - build: - env: - JAVA_VERSION: ${{ matrix.java_version }} - runs-on: windows-latest - strategy: - fail-fast: true - matrix: - java_version: [ 11, 17 ] - - steps: - - uses: actions/checkout@v4 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: ${{ matrix.java_version }} - - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 - - - name: "build using jdk ${{ matrix.java_version }}" - run: ./gradlew build - - - name: Upload windows build code coverage - uses: codecov/codecov-action@v4.4.1 - if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: current_windows - env_vars: JAVA_VERSION - # too many timeout errors, let's not fail at the moment - #fail_ci_if_error: true - - # TODO 3.0.0 re-activate scala API - # - name: composite build atrium-scala2 - # run: ./gradlew build - # working-directory: misc\tools\atrium-scala2-test - - - name: composite build atrium-samples-test - run: ./gradlew build - working-directory: misc\tools\atrium-samples-test - - # TODO 1.3.0 activate again once we use JS IR -# - name: composite build atrium-js-sample-test -# run: ./gradlew build -# working-directory: misc\tools\atrium-js-sample-test diff --git a/.github/workflows/ci.yml b/.github/workflows/quality-assurance.yml similarity index 86% rename from .github/workflows/ci.yml rename to .github/workflows/quality-assurance.yml index 0cee643fd3..9fbd211f48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/quality-assurance.yml @@ -1,6 +1,6 @@ -name: CI +name: Quality Assurance -on: [push, pull_request] +on: [ push, pull_request ] jobs: generate-matrix: @@ -10,11 +10,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v2 with: - node-version: '14' + fetch-depth: 1 - name: Generate matrix id: set-matrix @@ -28,11 +25,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 1 - name: Set up JDK ${{ matrix.java_version }} uses: actions/setup-java@v4 with: - distribution: 'adopt' + distribution: ${{ matrix.java_distribution }} java-version: ${{ matrix.java_version }} - name: Setup Gradle @@ -58,6 +57,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 1 - name: Cache Android jar id: android-cache @@ -85,7 +86,7 @@ jobs: run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer forwardCompatibility: - needs: dexer + needs: [] #Not sure if it should be left empty or if it should contain generate-matrix env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} @@ -93,14 +94,14 @@ jobs: strategy: fail-fast: false matrix: - kotlin_version: ['1.5', '1.6', '1.7', '1.8', '1.9', '2.0'] + kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] steps: - uses: actions/checkout@v4 - name: Set up JDK 17 uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: 17 + distribution: ${{ matrix.java_distribution }} + java-version: ${{ matrix.java_version }} - name: Setup Gradle uses: gradle/gradle-build-action@v3.3.2 diff --git a/README.md b/README.md index 4cf431630c..1d0d76a55d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Download](https://img.shields.io/badge/Download-1.2.0-%23007ec6)](https://central.sonatype.com/artifact/ch.tutteli.atrium/atrium-fluent/1.2.0) [![EUPL](https://img.shields.io/badge/%E2%9A%96-EUPL%201.2-%230b45a6)](https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12 "License") [![atrium @ kotlinlang.slack.com](https://img.shields.io/static/v1?label=kotlinlang&message=atrium&color=blue&logo=slack)](https://kotlinlang.slack.com/messages/atrium "See invitation link under section FAQ") -[![Build Status](https://github.com/robstoll/atrium/actions/workflows/ci.yml/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3Aci.yml+branch%3Amain) +[![Quality Assurance](https://github.com/robstoll/atrium/actions/workflows/quality-assurance.yml/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions/workflows/quality-assurance.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/robstoll/atrium/branch/main/graph/badge.svg)](https://app.codecov.io/github/robstoll/atrium/branch/main) [![Newcomers Welcome](https://img.shields.io/badge/%F0%9F%91%8B-Newcomers%20Welcome-blueviolet)](https://github.com/robstoll/atrium/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 "Ask in slack for help") diff --git a/feature-random-matrix-ci.patch b/feature-random-matrix-ci.patch deleted file mode 100644 index 80aa9a0f1efcaa92cd92c2bcac3216d70206a0e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13280 zcmdU$X>%0E8OQr|s`4Gi!XPLyySh0X0WyaJ80;W0FDMtaha?2LvJw)M@mEjs|MjC* zchB}pD?yS{P3`U+-A_OF)wBQp*CRJ@J8sKWZozfjqU*XDcT?v#-K;(wtFGs6>FS1# zRo8d(x?a>Vqw5(r?dCLkPWQUH$5mf*dit*1GeO?g?~3N_>X#Xn#!S20$#*5#+?#QK zb$@XIpW7Pwqvj3tc`D4d-M+ut)BV3`Eqn4Idvechx(#=rXDyB2bay<&2O7g%Aii`T zb#`56Gde2wMAu*l2D74!`*RvOtK+uLZt2dHe+Gu&x1t$c_g+wXf(pzx?pL=g$oJjf z-S4`-tmxgjyMS);Ov%v z!WeL>+$-S(C9GEoj*WUPSO)*l!M8&}8MqH_O}yFB)t;XXgj!FR1-UPX!0+h8>WBKh zFWiUcR$6J#!(Z3a13~1fExb2`#XCLi3Tnr5$*|wkHPi%(Yf%9w0>%5nsY&;$?tn|* zeb&5=W^4!|^rth|JYAJwtqP0%W2{X3x_Sym<8#RuQa27 z1RJ_vxQD{~fn@klqqaQW1|8pnt(dJxDuZPhHC>Ot+07_h>1w^c*N=$D;|zB&3HocY zz>mQLtUPiMocdlG>5AOl6BqC{JwG1n40F4pzw&fMm`%y$7KQW!|JM`l)v{spI4$87 zExldvEp5;Lpmmk|A{?-q1^rHa)59<-$+6N}qYp6RnA2zKn6g=21>3ZUrBARgkXvQNY2UqCe^LTF(vRo@QEN8oh;&v?1Dj7@ zIAI5sD65a8g&wuf46%~MoqZNK1WO7097QE#;U@GG{h&WTTEco>`2)F0SK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3IS`$NmRnolN+cICEJe#`8YW`y@pQttt`4x}S@MMIDdLwg>vG|z6fGFl3+y=>`> z@wV@OR}T4F7hMuLHK)sB>J*FkcD&EEs%#VK`@R=l5-BaG%OT_;RHm< zi|Rwa9?^r|Ql%~o(GDEASK`-M@{&i&J;+EN`R^Hh-_-v(YSrb)=jM!v!am6n;gl2=fqLE%`Hh1NWsg84m30V E18{2X+5i9m From 011c353bc076d39a4cda30e594a1e3c2243474b6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 04:35:59 +0000 Subject: [PATCH 07/19] chore(deps): update gradle/gradle-build-action action to v3.4.1 --- .github/workflows/build-ubuntu.yml | 4 ++-- .github/workflows/build-windows.yml | 2 +- .github/workflows/check-generated-committed.yml | 2 +- .github/workflows/generate-readme-examples.yml | 2 +- .github/workflows/samples-windows.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 46556fc728..20aa0d2fa4 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -21,7 +21,7 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.0 + uses: gradle/gradle-build-action@v3.4.1 - name: "build using jdk ${{ matrix.java_version }}" run: ./gradlew build @@ -94,7 +94,7 @@ jobs: distribution: 'adopt' java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.0 + uses: gradle/gradle-build-action@v3.4.1 - name: "build using kotlin ${{ matrix.kotlin_version }}" run: ./gradlew build diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index f46df07bb0..d0d5831cbd 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -20,7 +20,7 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.0 + uses: gradle/gradle-build-action@v3.4.1 - name: "build using jdk ${{ matrix.java_version }}" run: ./gradlew build diff --git a/.github/workflows/check-generated-committed.yml b/.github/workflows/check-generated-committed.yml index 7f0c0fb795..bf3d94ee5c 100644 --- a/.github/workflows/check-generated-committed.yml +++ b/.github/workflows/check-generated-committed.yml @@ -19,7 +19,7 @@ jobs: distribution: 'adopt' java-version: 11 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.0 + uses: gradle/gradle-build-action@v3.4.1 - name: check generateLogic committed run: ./gradle/scripts/check-generateLogic-committed.sh shell: bash diff --git a/.github/workflows/generate-readme-examples.yml b/.github/workflows/generate-readme-examples.yml index 98c9b1fb9f..caaf47729c 100644 --- a/.github/workflows/generate-readme-examples.yml +++ b/.github/workflows/generate-readme-examples.yml @@ -15,7 +15,7 @@ jobs: distribution: 'adopt' java-version: 11 - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.0 + uses: gradle/gradle-build-action@v3.4.1 - name: Generate readme run: ./gradlew :readme-examples:build diff --git a/.github/workflows/samples-windows.yml b/.github/workflows/samples-windows.yml index 7f233e7cea..d74760de26 100644 --- a/.github/workflows/samples-windows.yml +++ b/.github/workflows/samples-windows.yml @@ -25,7 +25,7 @@ jobs: java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.0 + uses: gradle/gradle-build-action@v3.4.1 - name: Cache maven dependencies uses: actions/cache@v4 From 28ff511a0d1b7a5d308eb5b9423da7ec8d2d0af8 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sat, 15 Jun 2024 23:49:07 +0200 Subject: [PATCH 08/19] ###feat/Updated custom random matrix generation - Updated distribution and java-version back to 'adopt' and '17' --- .github/workflows/quality-assurance.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/quality-assurance.yml b/.github/workflows/quality-assurance.yml index 9fbd211f48..eddab613d6 100644 --- a/.github/workflows/quality-assurance.yml +++ b/.github/workflows/quality-assurance.yml @@ -25,8 +25,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - name: Set up JDK ${{ matrix.java_version }} uses: actions/setup-java@v4 @@ -86,7 +84,7 @@ jobs: run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer forwardCompatibility: - needs: [] #Not sure if it should be left empty or if it should contain generate-matrix + needs: [] env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} @@ -100,8 +98,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v4 with: - distribution: ${{ matrix.java_distribution }} - java-version: ${{ matrix.java_version }} + distribution: 'adopt' + java-version: 17 - name: Setup Gradle uses: gradle/gradle-build-action@v3.3.2 From cbdb1370c871fc3601c571b8bef9010eb77ffe3e Mon Sep 17 00:00:00 2001 From: ScratchFiveK <60172985+BereKanters@users.noreply.github.com> Date: Sun, 16 Jun 2024 10:34:07 +0200 Subject: [PATCH 09/19] Samples for CharSequence to contain in api infix 1543 (#1774) Copied samples from api-fluent: - CharSequenceToContainCheckerSamples.kt - CharSequenceToContainCreatorSamples.kt - CharSequenceToContainSearchBehaviourSamples.kt - Transformed examples to the infix style. - Linked corresponding functions in the KDOC via @sample. - Updated regex patterns in CharSequenceToContainCreatorSamples to more complex patterns to differentiate them from simple value checks. - Revised tests for `value`, `values`, `regex`, and `elementsOf` to use more complex regex patterns like "A(BC|C/DC)". - Added @sample comments to ensure consistency with existing documentation and examples. --- .../en_GB/charSequenceToContainCheckers.kt | 7 + .../en_GB/charSequenceToContainCreators.kt | 19 ++ .../charSequenceToContainSearchBehaviours.kt | 2 + .../CharSequenceToContainCheckerSamples.kt | 54 +++++ .../CharSequenceToContainCreatorSamples.kt | 216 ++++++++++++++++++ ...SequenceToContainSearchBehaviourSamples.kt | 27 +++ 6 files changed, 325 insertions(+) create mode 100644 apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCheckerSamples.kt create mode 100644 apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCreatorSamples.kt create mode 100644 apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainSearchBehaviourSamples.kt diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCheckers.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCheckers.kt index 785a16b56d..e31fda4c04 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCheckers.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCheckers.kt @@ -16,6 +16,8 @@ import ch.tutteli.atrium.logic.creating.charsequence.contains.steps.* * @return The newly created builder. * @throws IllegalArgumentException In case [times] is smaller than zero. * @throws IllegalArgumentException In case [times] is zero; use [notToContain] instead. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCheckerSamples.atLeast + * */ infix fun CharSequenceContains.EntryPointStep.atLeast( times: Int @@ -36,6 +38,8 @@ infix fun CharSequenceContains.EntryPoin * @throws IllegalArgumentException In case [times] is zero; use [notToContain] instead. * @throws IllegalArgumentException In case [times] of this `at most` restriction equals to the number of the * `at least` restriction; use the [exactly] restriction instead. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCheckerSamples.butAtMost + * */ infix fun AtLeastCheckerStep.butAtMost( times: Int @@ -59,6 +63,7 @@ infix fun AtLeastCheckerStep.butAt * @return The newly created builder. * @throws IllegalArgumentException In case [times] is smaller than zero. * @throws IllegalArgumentException In case [times] is zero; use [notToContain] instead. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCheckerSamples.exactly */ infix fun CharSequenceContains.EntryPointStep.exactly( times: Int @@ -80,6 +85,7 @@ infix fun CharSequenceContains.EntryPoin * @throws IllegalArgumentException In case [times] is smaller than zero. * @throws IllegalArgumentException In case [times] is zero; use [notToContain] instead. * @throws IllegalArgumentException In case [times] equals to one; use [exactly] instead. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCheckerSamples.atMost */ infix fun CharSequenceContains.EntryPointStep.atMost( times: Int @@ -101,6 +107,7 @@ infix fun CharSequenceContains.EntryPoin * @return The newly created builder. * @throws IllegalArgumentException In case [times] is smaller than zero. * @throws IllegalArgumentException In case [times] is zero; use [notToContain] instead. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCheckerSamples.notOrAtMost */ infix fun CharSequenceContains.EntryPointStep.notOrAtMost( times: Int diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCreators.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCreators.kt index e30ea93b64..c755f2efbb 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCreators.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainCreators.kt @@ -13,6 +13,7 @@ import ch.tutteli.atrium.logic.creating.charsequence.contains.creators.regexIgno import ch.tutteli.atrium.logic.creating.charsequence.contains.creators.values import ch.tutteli.atrium.logic.creating.charsequence.contains.creators.valuesIgnoringCase import ch.tutteli.atrium.logic.creating.charsequence.contains.searchbehaviours.IgnoringCaseSearchBehaviour + import ch.tutteli.atrium.logic.creating.charsequence.contains.searchbehaviours.NoOpSearchBehaviour import ch.tutteli.atrium.logic.creating.typeutils.CharSequenceOrNumberOrChar import ch.tutteli.atrium.logic.creating.typeutils.IterableLike @@ -36,6 +37,8 @@ import kotlin.jvm.JvmName * * @return an [Expect] for the subject of `this` expectation. * @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char]. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.value + * */ infix fun CheckerStep.value( expected: CharSequenceOrNumberOrChar @@ -65,6 +68,7 @@ infix fun CheckerStep.value( * * @return an [Expect] for the subject of `this` expectation. * @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char]. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.values */ infix fun CheckerStep.the( values: Values @@ -87,6 +91,7 @@ infix fun CheckerStep.the( * * @return an [Expect] for the subject of `this` expectation. * @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char]. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.valueIgnoringCase */ @JvmName("valueIgnoringCase") infix fun CheckerStep.value( @@ -117,6 +122,7 @@ infix fun CheckerStep.value( * * @return an [Expect] for the subject of `this` expectation. * @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char]. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.valuesIgnoringCase */ @JvmName("valuesIgnoringCase") infix fun CheckerStep.the( @@ -139,6 +145,7 @@ infix fun CheckerStep.the( * * @return an [Expect] for the subject of `this` expectation. * @throws IllegalArgumentException in case [expected] is not a [CharSequence], [Number] or [Char]. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.valueIgnoringCaseWithChecker */ infix fun EntryPointStep.value( expected: CharSequenceOrNumberOrChar @@ -171,6 +178,7 @@ infix fun EntryPointStep.valu * * @return an [Expect] for the subject of `this` expectation. * @throws IllegalArgumentException in case one of the [values] is not a [CharSequence], [Number] or [Char]. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.valuesIgnoringCaseWithChecker */ infix fun EntryPointStep.the( values: Values @@ -185,6 +193,7 @@ infix fun EntryPointStep.the( * @param pattern The pattern which is expected to have a match against the input of the search. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.regex */ infix fun CheckerStep.regex(pattern: String): Expect = this the regexPatterns(pattern) @@ -198,6 +207,7 @@ infix fun CheckerStep.regex(pattern: * @param pattern The pattern which is expected to have a match against the input of the search. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.matchFor * * @since 0.12.0 */ @@ -224,6 +234,7 @@ infix fun CheckerStep.matchFor( * -- use the function `regexPatterns(t, ...)` to create a [RegexPatterns]. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.regex */ infix fun CheckerStep.the(patterns: RegexPatterns): Expect = _logicAppend { regex(patterns.toList()) } @@ -247,6 +258,7 @@ infix fun CheckerStep.the(patterns: R * use the function `all(Regex(...), ...)` to create a [All]. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.matchFor * * @since 0.12.0 */ @@ -262,6 +274,7 @@ infix fun CheckerStep.matchFor(patter * @param pattern The patterns which is expected to have a match against the input of the search. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.regexIgnoringCase */ @JvmName("regexIgnoringCase") infix fun CheckerStep.regex(pattern: String): Expect = @@ -286,6 +299,7 @@ infix fun CheckerStep.regex(p * -- use the function `regexPatterns(t, ...)` to create a [RegexPatterns]. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.regexIgnoringCaseWithChecker */ @JvmName("regexIgnoringCase") infix fun CheckerStep.the(patterns: RegexPatterns): Expect = @@ -300,6 +314,7 @@ infix fun CheckerStep.the(pat * @param pattern The patterns which is expected to have a match against the input of the search. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.regexIgnoringCase */ infix fun EntryPointStep.regex(pattern: String): Expect = this atLeast 1 regex pattern @@ -325,6 +340,7 @@ infix fun EntryPointStep.rege * use the function `regexPatterns(t, ...)` to create a [RegexPatterns]. * * @return an [Expect] for the subject of `this` expectation. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.regexIgnoringCase */ infix fun EntryPointStep.the(patterns: RegexPatterns): Expect = this atLeast 1 the patterns @@ -348,6 +364,7 @@ infix fun EntryPointStep.the( * [expectedIterableLike] does not have elements (is empty). * * @since 0.13.0 + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.elementsOf */ infix fun CheckerStep.elementsOf( expectedIterableLike: IterableLike @@ -374,6 +391,7 @@ infix fun CheckerStep.elementsOf( * [expectedIterableLike] does not have elements (is empty). * * @since 0.13.0 + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.elementsOfIgnoringCase */ @JvmName("elementsOfIgnoringCase") infix fun CheckerStep.elementsOf( @@ -401,6 +419,7 @@ infix fun CheckerStep.element * [expectedIterableLike] does not have elements (is empty). * * @since 0.13.0 + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainCreatorSamples.elementsOfIgnoringCase */ @JvmName("elementsOfIgnoringCase") infix fun EntryPointStep.elementsOf( diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainSearchBehaviours.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainSearchBehaviours.kt index fb1ae7176b..705679a294 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainSearchBehaviours.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/charSequenceToContainSearchBehaviours.kt @@ -17,6 +17,7 @@ import kotlin.jvm.JvmName * @param case Has to be `case`. * * @return The newly created builder. + * @sample ch.tutteli.atrium.api.infix.en_GB.samples.CharSequenceToContainSearchBehaviourSamples.ignoringCase */ infix fun CharSequenceContains.EntryPointStep.ignoring( @Suppress("UNUSED_PARAMETER") case: case @@ -28,6 +29,7 @@ infix fun CharSequenceContains.EntryPointStep NotCheckerStep.ignoring( @Suppress("UNUSED_PARAMETER") case: case diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCheckerSamples.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCheckerSamples.kt new file mode 100644 index 0000000000..53f125c209 --- /dev/null +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCheckerSamples.kt @@ -0,0 +1,54 @@ +package ch.tutteli.atrium.api.infix.en_GB.samples + +import ch.tutteli.atrium.api.infix.en_GB.* +import ch.tutteli.atrium.api.verbs.expect +import kotlin.test.Test + +class CharSequenceToContainCheckerSamples { + + @Test + fun atLeast() { + expect("ABBC") toContain o atLeast 2 value "B" + + fails { + expect("ABB") toContain o atLeast 2 value "A" + } + } + + @Test + fun atMost() { + expect("ABBC") toContain o atMost 2 value "B" + + fails { + expect("AABBAA") toContain o atMost 3 value "A" + } + } + + @Test + fun notOrAtMost() { + expect("ABBC") toContain o notOrAtMost 2 value "D" + expect("ABBC") toContain o notOrAtMost 2 value "B" + + fails { + expect("AABBAA") toContain o notOrAtMost 3 value "A" + } + } + + @Test + fun butAtMost() { + expect("ABBC") toContain o atLeast 1 butAtMost 2 value "B" + + fails { + expect("ABBBBCD") toContain o atLeast 2 butAtMost 3 value "B" + } + } + + @Test + fun exactly() { + expect("ABCBAC") toContain o exactly 2 value "C" + + fails { + expect("ABBBBCD") toContain o exactly 3 value "B" + } + } +} diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCreatorSamples.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCreatorSamples.kt new file mode 100644 index 0000000000..c1ec8b78d7 --- /dev/null +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCreatorSamples.kt @@ -0,0 +1,216 @@ +package ch.tutteli.atrium.api.infix.en_GB.samples + +import ch.tutteli.atrium.api.infix.en_GB.* +import ch.tutteli.atrium.api.verbs.expect +import kotlin.test.Test + +class CharSequenceToContainCreatorSamples { + + @Test + fun value() { + // `value` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABC") toContain o exactly 1 value "A" + expect("ABBBC") toContain o atLeast 2 value "B" + + fails { + expect("AAAAAA") toContain o atMost 3 value "A" + } + } + + @Test + fun valueIgnoringCase() { + expect("ABC") toContain o ignoring case value "a" + expect("AbbbC") toContain o ignoring case value "B" + + fails { + expect("AAAAAA") toContain o ignoring case value "B" + } + } + + @Test + fun valueIgnoringCaseWithChecker() { + // `value` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABC") toContain o ignoring case exactly 1 value "A" + expect("AAABBC") toContain o ignoring case atMost 3 value "b" + expect("aBBBCD") toContain o ignoring case atLeast 1 value "A" + + fails { + expect("AAAAAABBBB") toContain o ignoring case atMost 3 value "A" + } + fails { + expect("AAABBBb") toContain o ignoring case exactly 3 value "b" + } + fails { + expect("AAAAAABBBB") toContain o ignoring case atLeast 3 value "D" + } + } + + @Test + fun values() { + // `values` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABC") toContain o exactly 1 the values("A","B","C") + expect("AAABC") toContain o atMost 3 the values("A", "B", "C") + expect("ABBBCD") toContain o atLeast 1 the values("A", "B", "C", "D") + + fails { + expect("AAAAAABBBB") toContain o atMost 3 the values("A", "B") + } + fails { + expect("AAABBBB") toContain o exactly 3 the values("A", "B") + } + fails { + expect("AAAAAABBBB") toContain o atLeast 3 the values("A", "B", "C") + } + } + + @Test + fun valuesIgnoringCase() { + expect("AbC") toContain o ignoring case the values("A", "B", "c") + + fails { + expect("aabaabbb") toContain o ignoring case the values("A", "B", "C") + } + } + + @Test + fun valuesIgnoringCaseWithChecker() { + // `values` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABc") toContain o ignoring case exactly 1 the values("A", "b", "C") + expect("AaaBC") toContain o ignoring case atMost 3 the values("A", "B", "c") + expect("ABBBcD") toContain o ignoring case atLeast 1 the values("a", "b", "C", "d") + + fails { + expect("AAAAAABBBB") toContain o ignoring case atMost 3 the values("a", "b") + } + fails { + expect("AAABBBB") toContain o ignoring case exactly 3 the values("A", "b") + } + fails { + expect("AAAAAABBBB") toContain o ignoring case atLeast 3 the values("a", "b", "C") + } + } + + + @Test + fun regex() { + expect("ABC") toContain o exactly 1 regex "A(BC|C/DC)" + expect("AAABC") toContain o atMost 3 regex "A(BC|C/DC)" + expect("ABBBCD") toContain o atLeast 1 regex "AB[BC]+" + + fails { + expect("AAAAAABBBB") toContain o atMost 3 regex "A(BC|C/DC)" + } + fails { + expect("AAABBBB") toContain o exactly 3 regex "A(BC|C/DC)" + } + fails { + expect("AAAAAABBBB") toContain o atLeast 3 regex "A(BC|C/DC)" + } + } + + @Test + fun regexIgnoringCase() { + expect("AbC") toContain o ignoring case regex "A(BC|C/DC)" + + fails { + expect("aabaabbb") toContain o ignoring case regex "A(BC|C/DC)" + } + } + + @Test + fun regexIgnoringCaseWithChecker() { + // `regex` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABc") toContain o ignoring case exactly 1 regex "A(BC|C/DC)" + expect("AaaBC") toContain o ignoring case atMost 3 regex "A(BC|C/DC)" + expect("ABBBcD") toContain o ignoring case atLeast 1 regex "AB[BC]+" + + fails { + expect("AAAAAABBBB") toContain o ignoring case atMost 3 regex "A(BC|C/DC)" + } + fails { + expect("AAABBBB") toContain o ignoring case exactly 3 regex "A(BC|C/DC)" + } + fails { + expect("AAAAAABBBB") toContain o ignoring case atLeast 3 regex "A(BC|C/DC)" + } + } + + @Test + fun matchFor() { + // `matchFor` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABC") toContain o exactly 1 matchFor Regex("A(BC|C/DC)") + expect("AAABC") toContain o atMost 3 matchFor Regex("A(BC|C/DC)") + expect("ABBBCD") toContain o atLeast 1 matchFor Regex("AB[BC]+") + + fails { + expect("AAAAAABBBB") toContain o atMost 3 matchFor Regex("A(BC|C/DC)") + } + fails { + expect("AAABBBB") toContain o exactly 3 matchFor Regex("A(BC|C/DC)") + } + fails { + expect("AAAAAABBBB") toContain o atLeast 3 matchFor Regex("A(BC|C/DC)") + } + } + + @Test + fun elementsOf() { + // `elementsOf` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABC") toContain o exactly 1 elementsOf listOf("A", "B", "C") + expect("AAABC") toContain o atMost 3 elementsOf listOf("A", "B", "C") + expect("ABBBCD") toContain o atLeast 1 elementsOf listOf("A", "B", "C", "D") + + fails { + expect("AAAAAABBBB") toContain o atMost 3 elementsOf listOf("A", "B") + } + fails { + expect("AAABBBB") toContain o exactly 3 elementsOf listOf("A", "B") + } + fails { + expect("AAAAAABBBB") toContain o atLeast 3 elementsOf listOf("A", "B", "C") + } + } + + @Test + fun elementsOfIgnoreCase() { + expect("AbC") toContain o ignoring case elementsOf listOf("A", "B", "c") + + fails { + expect("aabaabbb") toContain o ignoring case elementsOf listOf("A", "B", "C") + } + } + + @Test + fun elementsOfIgnoringCaseWithChecker() { + // `elementsOf` is a final step in the CharSequence.toContain expectation-building process and can be used with + // various checkers (see CharSequenceToContainCheckerSamples) + + expect("ABc") toContain o ignoring case exactly 1 elementsOf listOf("A", "b", "C") + expect("AaaBC") toContain o ignoring case atMost 3 elementsOf listOf("A", "B", "c") + expect("ABBBcD") toContain o ignoring case atLeast 1 elementsOf listOf("a", "b", "C", "d") + + fails { + expect("AAAAAABBBB") toContain o ignoring case atMost 3 elementsOf listOf("a", "b") + } + fails { + expect("AAABBBB") toContain o ignoring case exactly 3 elementsOf listOf("A", "b") + } + fails { + expect("AAAAAABBBB") toContain o ignoring case atLeast 3 elementsOf listOf("a", "b", "C") + } + } +} diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainSearchBehaviourSamples.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainSearchBehaviourSamples.kt new file mode 100644 index 0000000000..3f96ce2470 --- /dev/null +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainSearchBehaviourSamples.kt @@ -0,0 +1,27 @@ +package ch.tutteli.atrium.api.infix.en_GB.samples + +import ch.tutteli.atrium.api.infix.en_GB.* +import ch.tutteli.atrium.api.verbs.expect +import kotlin.test.Test + +class CharSequenceToContainSearchBehaviourSamples { + + @Test + fun ignoringCase() { + expect("ABC") toContain o ignoring case exactly 1 value "a" + expect("ABbC") toContain o ignoring case atLeast 2 value "b" + + fails { + expect("AAAaaa") toContain o ignoring case atMost 3 value "a" + } + } + + @Test + fun ignoringCaseWithNotChecker() { + expect("ABC") notToContain o ignoring case value "d" + + fails { // because it contains a `d` which is the same as a `D` when case is ignored + expect("abcd") notToContain o ignoring case value "D" + } + } +} From 54bcb6515108834f0fd497f57dcb03d447d7dee1 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Tue, 11 Jun 2024 13:22:39 +0200 Subject: [PATCH 10/19] ###feature/Integrate random matrix generation and merge Ubuntu and Windows workflows - Added a new CI workflow using vlsi/github-actions-random-matrix to generate a dynamic matrix for testing on both Ubuntu and Windows with JDK 8 and JDK 11. - Merged existing build steps for Ubuntu and Windows into a single workflow file (ci.yml). - Moved common steps, such as caching the Android jar and compiling, into a separate setup job to improve CI efficiency. - Updated README.md to reflect the new combined CI workflow badge. - Improved test coverage and reduced CI resource usage by leveraging the matrix strategy. --- .github/workflows/ci.yml | 115 +++++++++++++++++++++++++++++++++++++++ README.md | 3 +- 2 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..4785b82986 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,115 @@ +name: CI + +on: [ push, pull_request ] + +jobs: + # Job to generate the matrix + generate-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate matrix + id: set-matrix + uses: vlsi/github-actions-random-matrix@v1 + with: + include: | + [ + {"os": "ubuntu-latest", "java_version": "11"}, + {"os": "ubuntu-latest", "java_version": "17"}, + {"os": "windows-latest", "java_version": "11"}, + {"os": "windows-latest", "java_version": "17"} + ] + + # Setup job to run common steps + setup: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache Android jar + id: android-cache + uses: actions/cache@v4 + with: + path: android-jar-cache + key: ${{ runner.os }}-android-version-26 + + - name: Download Android SDK's android.jar (or use cached file) + if: steps.android-cache.outputs.cache-hit != 'true' + run: | + mkdir android-jar-cache + cd android-jar-cache + curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" + echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 + if ! sha256sum -c android.sha256; then + echo >&2 "wrong sha256 for android.jar, expected:" + cat >&2 android.sha256 + echo >&2 "actual:" + sha256sum android.jar + exit 1; + fi + + # Main build and test job using the generated matrix + build-and-test: + needs: [generate-matrix, setup] + runs-on: ${{ matrix.os }} + strategy: + matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: ${{ matrix.java_version }} + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3.3.2 + + - name: Build using JDK ${{ matrix.java_version }} + run: ./gradlew build + + - name: Upload build code coverage + uses: codecov/codecov-action@v4.4.1 + if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: ${{ matrix.os == 'windows-latest' && 'current_windows' || 'current' }} + env_vars: JAVA_VERSION + + - name: Check Atrium's -jvm.jar can be dexed + run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer + + - name: Composite build atrium-samples-test + run: ./gradlew build + working-directory: misc/tools/atrium-samples-test + + forwardCompatibility: + needs: setup + env: + JAVA_VERSION: 17 + KOTLIN_VERSION: ${{ matrix.kotlin_version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: 17 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3.3.2 + + - name: Build using Kotlin ${{ matrix.kotlin_version }} + run: ./gradlew build diff --git a/README.md b/README.md index 476f74c9a8..4cf431630c 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ [![Download](https://img.shields.io/badge/Download-1.2.0-%23007ec6)](https://central.sonatype.com/artifact/ch.tutteli.atrium/atrium-fluent/1.2.0) [![EUPL](https://img.shields.io/badge/%E2%9A%96-EUPL%201.2-%230b45a6)](https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12 "License") [![atrium @ kotlinlang.slack.com](https://img.shields.io/static/v1?label=kotlinlang&message=atrium&color=blue&logo=slack)](https://kotlinlang.slack.com/messages/atrium "See invitation link under section FAQ") -[![Build Status Ubuntu](https://github.com/robstoll/atrium/workflows/Ubuntu/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3AUbuntu+branch%3Amain) -[![Build Status Windows](https://github.com/robstoll/atrium/workflows/Windows/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3AWindows+branch%3Amain) +[![Build Status](https://github.com/robstoll/atrium/actions/workflows/ci.yml/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3Aci.yml+branch%3Amain) [![Coverage](https://codecov.io/gh/robstoll/atrium/branch/main/graph/badge.svg)](https://app.codecov.io/github/robstoll/atrium/branch/main) [![Newcomers Welcome](https://img.shields.io/badge/%F0%9F%91%8B-Newcomers%20Welcome-blueviolet)](https://github.com/robstoll/atrium/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 "Ask in slack for help") From 85347295f0a1e9e0db20f4ce2eb533b40feb6a83 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Wed, 12 Jun 2024 11:39:03 +0200 Subject: [PATCH 11/19] ###feature/Added feature-random-matrix-ci.patch file - Added a new patch file --- feature-random-matrix-ci.patch | Bin 0 -> 13280 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 feature-random-matrix-ci.patch diff --git a/feature-random-matrix-ci.patch b/feature-random-matrix-ci.patch new file mode 100644 index 0000000000000000000000000000000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;gl2=fqLE%`Hh1NWsg84m30V E18{2X+5i9m literal 0 HcmV?d00001 From 1c6ae483dacfb610824aa00047a5db35f9f66635 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Fri, 14 Jun 2024 22:28:42 +0200 Subject: [PATCH 12/19] ###feat/Integrate custom random matrix generation and merge Ubuntu and Windows workflows updated based on feedback - Added custom matrix generation scripts (`matrix_builder.js` and `matrix.js`) to dynamically generate the matrix for CI jobs. - Configured the GitHub Actions workflow (`ci.yml`) to use the custom matrix generator. - Renamed the `setup` job to `dexer` and included the step to check if Atrium's -jvm.jar can be dexed. --- .github/workflows/ci.yml | 88 +++++------ .github/workflows/matrix.js | 29 ++++ .github/workflows/matrix_builder.js | 236 ++++++++++++++++++++++++++++ 3 files changed, 306 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/matrix.js create mode 100644 .github/workflows/matrix_builder.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4785b82986..0cee643fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,8 @@ name: CI -on: [ push, pull_request ] +on: [push, pull_request] jobs: - # Job to generate the matrix generate-matrix: runs-on: ubuntu-latest outputs: @@ -12,50 +11,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Generate matrix - id: set-matrix - uses: vlsi/github-actions-random-matrix@v1 - with: - include: | - [ - {"os": "ubuntu-latest", "java_version": "11"}, - {"os": "ubuntu-latest", "java_version": "17"}, - {"os": "windows-latest", "java_version": "11"}, - {"os": "windows-latest", "java_version": "17"} - ] - - # Setup job to run common steps - setup: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cache Android jar - id: android-cache - uses: actions/cache@v4 + - name: Set up Node.js + uses: actions/setup-node@v2 with: - path: android-jar-cache - key: ${{ runner.os }}-android-version-26 + node-version: '14' - - name: Download Android SDK's android.jar (or use cached file) - if: steps.android-cache.outputs.cache-hit != 'true' - run: | - mkdir android-jar-cache - cd android-jar-cache - curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" - echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 - if ! sha256sum -c android.sha256; then - echo >&2 "wrong sha256 for android.jar, expected:" - cat >&2 android.sha256 - echo >&2 "actual:" - sha256sum android.jar - exit 1; - fi + - name: Generate matrix + id: set-matrix + run: node .github/workflows/matrix.js - # Main build and test job using the generated matrix build-and-test: - needs: [generate-matrix, setup] + needs: generate-matrix runs-on: ${{ matrix.os }} strategy: matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} @@ -83,15 +49,43 @@ jobs: flags: ${{ matrix.os == 'windows-latest' && 'current_windows' || 'current' }} env_vars: JAVA_VERSION - - name: Check Atrium's -jvm.jar can be dexed - run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer - - name: Composite build atrium-samples-test run: ./gradlew build working-directory: misc/tools/atrium-samples-test + dexer: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache Android jar + id: android-cache + uses: actions/cache@v4 + with: + path: android-jar-cache + key: ${{ runner.os }}-android-version-26 + + - name: Download Android SDK's android.jar (or use cached file) + if: steps.android-cache.outputs.cache-hit != 'true' + run: | + mkdir android-jar-cache + cd android-jar-cache + curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" + echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 + if ! sha256sum -c android.sha256; then + echo >&2 "wrong sha256 for android.jar, expected:" + cat >&2 android.sha256 + echo >&2 "actual:" + sha256sum android.jar + exit 1; + fi + + - name: Check Atrium's -jvm.jar can be dexed + run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer + forwardCompatibility: - needs: setup + needs: dexer env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} @@ -99,7 +93,7 @@ jobs: strategy: fail-fast: false matrix: - kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] + kotlin_version: ['1.5', '1.6', '1.7', '1.8', '1.9', '2.0'] steps: - uses: actions/checkout@v4 - name: Set up JDK 17 diff --git a/.github/workflows/matrix.js b/.github/workflows/matrix.js new file mode 100644 index 0000000000..21f414c3b9 --- /dev/null +++ b/.github/workflows/matrix.js @@ -0,0 +1,29 @@ +let { MatrixBuilder } = require('./matrix_builder'); +const matrix = new MatrixBuilder(); + +// Add axes for the matrix +matrix.addAxis({ + name: 'os', + title: x => x.replace('-latest', ''), + values: ['ubuntu-latest', 'windows-latest'] +}); +matrix.addAxis({ + name: 'java_version', + values: ['11', '17'] +}); + +// Ensure at least one windows and at least one linux job is present (macos is almost the same as linux) +matrix.generateRow({ os: 'windows-latest' }); +matrix.generateRow({ os: 'ubuntu-latest' }); + +// Generate more rows, no duplicates would be generated +const include = matrix.generateRows(process.env.MATRIX_JOBS || 5); +if (include.length === 0) { + throw new Error('Matrix list is empty'); +} +// Sort jobs by name, however, numeric parts are sorted appropriately +// For instance, 'windows 8' would come before 'windows 11' +include.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true })); + +console.log(include); +console.log('::set-output name=matrix::' + JSON.stringify({ include })); diff --git a/.github/workflows/matrix_builder.js b/.github/workflows/matrix_builder.js new file mode 100644 index 0000000000..4cf2b8e5cb --- /dev/null +++ b/.github/workflows/matrix_builder.js @@ -0,0 +1,236 @@ +// License: Apache-2.0 +// Copyright Vladimir Sitnikov, 2021 +// See https://github.com/vlsi/github-actions-random-matrix + +class Axis { + constructor({name, title, values}) { + this.name = name; + this.title = title; + this.values = values; + // If all entries have same weight, the axis has uniform distribution + this.uniform = values.reduce((a, b) => a === (b.weight || 1) ? a : 0, values[0].weight || 1) !== 0 + this.totalWeight = this.uniform ? values.length : values.reduce((a, b) => a + (b.weight || 1), 0); + } + + static matches(row, filter) { + if (typeof filter === 'function') { + return filter(row); + } + if (Array.isArray(filter)) { + // e.g. row={os: 'windows'}; filter=[{os: 'linux'}, {os: 'linux'}] + return filter.find(v => Axis.matches(row, v)); + } + if (typeof filter === 'object') { + // e.g. row={jdk: {name: 'openjdk', version: 8}}; filter={jdk: {version: 8}} + for (const [key, value] of Object.entries(filter)) { + if (!row.hasOwnProperty(key) || !Axis.matches(row[key], value)) { + return false; + } + } + return true; + } + return row === filter; + } + + pickValue(filter) { + let values = this.values; + if (filter) { + values = values.filter(v => Axis.matches(v, filter)); + } + if (values.length === 0) { + const filterStr = typeof filter === 'string' ? filter.toString() : JSON.stringify(filter); + throw Error(`No values produces for axis '${this.name}' from ${JSON.stringify(this.values)}, filter=${filterStr}`); + } + if (values.length === 1) { + return values[0]; + } + if (this.uniform) { + return values[Math.floor(Math.random() * values.length)]; + } + const totalWeight = !filter ? this.totalWeight : values.reduce((a, b) => a + (b.weight || 1), 0); + let weight = Math.random() * totalWeight; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + weight -= value.weight || 1; + if (weight <= 0) { + return value; + } + } + return values[values.length - 1]; + } +} + +class MatrixBuilder { + constructor() { + this.axes = []; + this.axisByName = {}; + this.rows = []; + this.duplicates = {}; + this.excludes = []; + this.includes = []; + this.failOnUnsatisfiableFilters = false; + } + + /** + * Specifies include filter (all the generated rows would comply with all the include filters) + * @param filter + */ + include(filter) { + this.includes.push(filter); + } + + /** + * Specifies exclude filter (e.g. exclude a forbidden combination) + * @param filter + */ + exclude(filter) { + this.excludes.push(filter); + } + + addAxis({name, title, values}) { + const axis = new Axis({name, title, values}); + this.axes.push(axis); + this.axisByName[name] = axis; + return axis; + } + + setNamePattern(names) { + this.namePattern = names; + } + + /** + * Returns true if the row matches the include and exclude filters. + * @param row input row + * @returns {boolean} + */ + matches(row) { + return (this.excludes.length === 0 || !this.excludes.find(f => Axis.matches(row, f))) && + (this.includes.length === 0 || this.includes.find(f => Axis.matches(row, f))); + } + + failOnUnsatisfiableFilters(value) { + this.failOnUnsatisfiableFilters = value; + } + + /** + * Adds a row that matches the given filter to the resulting matrix. + * filter values could be + * - literal values: filter={os: 'windows-latest'} + * - arrays: filter={os: ['windows-latest', 'linux-latest']} + * - functions: filter={os: x => x!='windows-latest'} + * @param filter object with keys matching axes names + * @returns {*} + */ + generateRow(filter) { + let res; + if (filter) { + // If matching row already exists, no need to generate more + res = this.rows.find(v => Axis.matches(v, filter)); + if (res) { + return res; + } + } + for (let i = 0; i < 142; i++) { + res = this.axes.reduce( + (prev, next) => + Object.assign(prev, { + [next.name]: next.pickValue(filter ? filter[next.name] : undefined) + }), + {} + ); + if (!this.matches(res)) { + continue; + } + const key = JSON.stringify(res); + if (!this.duplicates.hasOwnProperty(key)) { + this.duplicates[key] = true; + res.name = + this.namePattern.map(axisName => { + let value = res[axisName]; + const title = value.title; + if (typeof title != 'undefined') { + return title; + } + const computeTitle = this.axisByName[axisName].title; + return computeTitle ? computeTitle(value) : value; + }).filter(Boolean).join(", "); + this.rows.push(res); + return res; + } + } + const filterStr = typeof filter === 'string' ? filter.toString() : JSON.stringify(filter); + const msg = `Unable to generate row for ${filterStr}. Please check include and exclude filters`; + if (this.failOnUnsatisfiableFilters) { + throw Error(msg); + } else { + console.warn(msg); + } + } + + generateRows(maxRows, filter) { + for (let i = 0; this.rows.length < maxRows && i < maxRows; i++) { + this.generateRow(filter); + } + return this.rows; + } + + /** + * Computes the number of all the possible combinations. + * @returns {{bad: number, good: number}} + */ + summary() { + let position = -1; + let indices = []; + let values = {}; + const axes = this.axes; + function resetValuesUpTo(nextPosition) { + for(let i=0; i Date: Sat, 15 Jun 2024 01:04:17 +0200 Subject: [PATCH 13/19] - Updated the `forwardCompatibility` job to run in parallel with `dexer` by removing the unnecessary dependency. - Added `fetch-depth: 1` to all checkout steps for faster execution. - Removed unnecessary Node.js setup step since Node.js is pre-installed on the runner. - Updated the README file to reflect the new combined CI workflow badge. - Removed patch file --- .github/workflows/build-ubuntu.yml | 100 ------------------ .github/workflows/build-windows.yml | 50 --------- .../{ci.yml => quality-assurance.yml} | 29 ++--- README.md | 2 +- feature-random-matrix-ci.patch | Bin 13280 -> 0 bytes 5 files changed, 16 insertions(+), 165 deletions(-) delete mode 100644 .github/workflows/build-ubuntu.yml delete mode 100644 .github/workflows/build-windows.yml rename .github/workflows/{ci.yml => quality-assurance.yml} (82%) delete mode 100644 feature-random-matrix-ci.patch diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml deleted file mode 100644 index 20aa0d2fa4..0000000000 --- a/.github/workflows/build-ubuntu.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Ubuntu - -on: [ push, pull_request ] - -jobs: - build: - env: - android-version: 26 - JAVA_VERSION: ${{ matrix.java_version }} - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - java_version: [ 11, 17 ] - - steps: - - uses: actions/checkout@v4 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: ${{ matrix.java_version }} - - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.1 - - - name: "build using jdk ${{ matrix.java_version }}" - run: ./gradlew build - - - name: Upload build code coverage - uses: codecov/codecov-action@v4.5.0 - if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} - - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: current - env_vars: JAVA_VERSION - # too many timeout errors, let's not fail at the moment - #fail_ci_if_error: true - - - name: Cache android jar - id: android-cache - uses: actions/cache@v4 - with: - path: android-jar-cache - key: ${{ runner.os }}-android-version-${{ env.android-version }} - - - name: download Android SDK's android.jar (or use cached file) - if: steps.android-cache.outputs.cache-hit != 'true' - run: | - mkdir android-jar-cache - cd android-jar-cache - curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-${{ env.android-version }}/android.jar?raw=true" - echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" >android.sha256 - if ! sha256sum -c android.sha256; then - echo >&2 "wrong sha256 for android.jar, expected:" - cat >&2 android.sha256 - echo >&2 "actual:" - sha256sum android.jar - exit 1; - fi - - - name: check Atrium's -jvm.jar can be dexed - run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer - - # TODO 3.0.0 re-activate scala API - # - name: composite build atrium-scala2 - # run: ./gradlew build - # working-directory: misc/tools/atrium-scala2-test - - - - name: composite build atrium-samples-test - run: ./gradlew build - working-directory: misc/tools/atrium-samples-test - - # TODO 1.3.0 activate again once we use JS IR - # - name: composite build atrium-js-sample-test - # run: ./gradlew build - # working-directory: misc/tools/atrium-js-sample-test - - forwardCompatibility: - env: - JAVA_VERSION: 17 - KOTLIN_VERSION: ${{ matrix.kotlin_version }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] - steps: - - uses: actions/checkout@v4 - - name: "Set up JDK 17" - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: 17 - - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.1 - - - name: "build using kotlin ${{ matrix.kotlin_version }}" - run: ./gradlew build diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml deleted file mode 100644 index d0d5831cbd..0000000000 --- a/.github/workflows/build-windows.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Windows - -on: [ push, pull_request ] - -jobs: - build: - env: - JAVA_VERSION: ${{ matrix.java_version }} - runs-on: windows-latest - strategy: - fail-fast: true - matrix: - java_version: [ 11, 17 ] - - steps: - - uses: actions/checkout@v4 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v4 - with: - distribution: 'adopt' - java-version: ${{ matrix.java_version }} - - name: Setup Gradle - uses: gradle/gradle-build-action@v3.4.1 - - - name: "build using jdk ${{ matrix.java_version }}" - run: ./gradlew build - - - name: Upload windows build code coverage - uses: codecov/codecov-action@v4.5.0 - if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: current_windows - env_vars: JAVA_VERSION - # too many timeout errors, let's not fail at the moment - #fail_ci_if_error: true - - # TODO 3.0.0 re-activate scala API - # - name: composite build atrium-scala2 - # run: ./gradlew build - # working-directory: misc\tools\atrium-scala2-test - - - name: composite build atrium-samples-test - run: ./gradlew build - working-directory: misc\tools\atrium-samples-test - - # TODO 1.3.0 activate again once we use JS IR -# - name: composite build atrium-js-sample-test -# run: ./gradlew build -# working-directory: misc\tools\atrium-js-sample-test diff --git a/.github/workflows/ci.yml b/.github/workflows/quality-assurance.yml similarity index 82% rename from .github/workflows/ci.yml rename to .github/workflows/quality-assurance.yml index 0cee643fd3..419dfe717f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/quality-assurance.yml @@ -1,6 +1,6 @@ -name: CI +name: Quality Assurance -on: [push, pull_request] +on: [ push, pull_request ] jobs: generate-matrix: @@ -10,11 +10,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v2 with: - node-version: '14' + fetch-depth: 1 - name: Generate matrix id: set-matrix @@ -28,21 +25,23 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 1 - name: Set up JDK ${{ matrix.java_version }} uses: actions/setup-java@v4 with: - distribution: 'adopt' + distribution: ${{ matrix.java_distribution }} java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.1 - name: Build using JDK ${{ matrix.java_version }} run: ./gradlew build - name: Upload build code coverage - uses: codecov/codecov-action@v4.4.1 + uses: codecov/codecov-action@v4.5.0 if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} with: token: ${{ secrets.CODECOV_TOKEN }} @@ -58,6 +57,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 1 - name: Cache Android jar id: android-cache @@ -85,7 +86,7 @@ jobs: run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer forwardCompatibility: - needs: dexer + needs: [] #Not sure if it should be left empty or if it should contain generate-matrix env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} @@ -93,17 +94,17 @@ jobs: strategy: fail-fast: false matrix: - kotlin_version: ['1.5', '1.6', '1.7', '1.8', '1.9', '2.0'] + kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] steps: - uses: actions/checkout@v4 - name: Set up JDK 17 uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: 17 + distribution: ${{ matrix.java_distribution }} + java-version: ${{ matrix.java_version }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3.3.2 + uses: gradle/gradle-build-action@v3.4.1 - name: Build using Kotlin ${{ matrix.kotlin_version }} run: ./gradlew build diff --git a/README.md b/README.md index 4cf431630c..1d0d76a55d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Download](https://img.shields.io/badge/Download-1.2.0-%23007ec6)](https://central.sonatype.com/artifact/ch.tutteli.atrium/atrium-fluent/1.2.0) [![EUPL](https://img.shields.io/badge/%E2%9A%96-EUPL%201.2-%230b45a6)](https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12 "License") [![atrium @ kotlinlang.slack.com](https://img.shields.io/static/v1?label=kotlinlang&message=atrium&color=blue&logo=slack)](https://kotlinlang.slack.com/messages/atrium "See invitation link under section FAQ") -[![Build Status](https://github.com/robstoll/atrium/actions/workflows/ci.yml/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions?query=workflow%3Aci.yml+branch%3Amain) +[![Quality Assurance](https://github.com/robstoll/atrium/actions/workflows/quality-assurance.yml/badge.svg?event=push&branch=main)](https://github.com/robstoll/atrium/actions/workflows/quality-assurance.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/robstoll/atrium/branch/main/graph/badge.svg)](https://app.codecov.io/github/robstoll/atrium/branch/main) [![Newcomers Welcome](https://img.shields.io/badge/%F0%9F%91%8B-Newcomers%20Welcome-blueviolet)](https://github.com/robstoll/atrium/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 "Ask in slack for help") diff --git a/feature-random-matrix-ci.patch b/feature-random-matrix-ci.patch deleted file mode 100644 index 80aa9a0f1efcaa92cd92c2bcac3216d70206a0e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13280 zcmdU$X>%0E8OQr|s`4Gi!XPLyySh0X0WyaJ80;W0FDMtaha?2LvJw)M@mEjs|MjC* zchB}pD?yS{P3`U+-A_OF)wBQp*CRJ@J8sKWZozfjqU*XDcT?v#-K;(wtFGs6>FS1# zRo8d(x?a>Vqw5(r?dCLkPWQUH$5mf*dit*1GeO?g?~3N_>X#Xn#!S20$#*5#+?#QK zb$@XIpW7Pwqvj3tc`D4d-M+ut)BV3`Eqn4Idvechx(#=rXDyB2bay<&2O7g%Aii`T zb#`56Gde2wMAu*l2D74!`*RvOtK+uLZt2dHe+Gu&x1t$c_g+wXf(pzx?pL=g$oJjf z-S4`-tmxgjyMS);Ov%v z!WeL>+$-S(C9GEoj*WUPSO)*l!M8&}8MqH_O}yFB)t;XXgj!FR1-UPX!0+h8>WBKh zFWiUcR$6J#!(Z3a13~1fExb2`#XCLi3Tnr5$*|wkHPi%(Yf%9w0>%5nsY&;$?tn|* zeb&5=W^4!|^rth|JYAJwtqP0%W2{X3x_Sym<8#RuQa27 z1RJ_vxQD{~fn@klqqaQW1|8pnt(dJxDuZPhHC>Ot+07_h>1w^c*N=$D;|zB&3HocY zz>mQLtUPiMocdlG>5AOl6BqC{JwG1n40F4pzw&fMm`%y$7KQW!|JM`l)v{spI4$87 zExldvEp5;Lpmmk|A{?-q1^rHa)59<-$+6N}qYp6RnA2zKn6g=21>3ZUrBARgkXvQNY2UqCe^LTF(vRo@QEN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=@sIo!xgO{{P>U7tUKsbO2Y8zUf5W~AGKn39O7G<^yMG)@sXnsyv}dq#1efTU zziU~NNM3IS`$NmRnolN+cICEJe#`8YW`y@pQttt`4x}S@MMIDdLwg>vG|z6fGFl3+y=>`> z@wV@OR}T4F7hMuLHK)sB>J*FkcD&EEs%#VK`@R=l5-BaG%OT_;RHm< zi|Rwa9?^r|Ql%~o(GDEASK`-M@{&i&J;+EN`R^Hh-_-v(YSrb)=jM!v!am6n;gl2=fqLE%`Hh1NWsg84m30V E18{2X+5i9m From 0f3bb2c56d5afb83b957b1f72658edfca004a8ab Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sat, 15 Jun 2024 23:49:07 +0200 Subject: [PATCH 14/19] ###feat/Updated custom random matrix generation - Updated distribution and java-version back to 'adopt' and '17' --- .github/workflows/quality-assurance.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/quality-assurance.yml b/.github/workflows/quality-assurance.yml index 419dfe717f..0d2a8ec706 100644 --- a/.github/workflows/quality-assurance.yml +++ b/.github/workflows/quality-assurance.yml @@ -25,8 +25,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - name: Set up JDK ${{ matrix.java_version }} uses: actions/setup-java@v4 @@ -86,7 +84,7 @@ jobs: run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer forwardCompatibility: - needs: [] #Not sure if it should be left empty or if it should contain generate-matrix + needs: [] env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} @@ -100,8 +98,8 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v4 with: - distribution: ${{ matrix.java_distribution }} - java-version: ${{ matrix.java_version }} + distribution: 'adopt' + java-version: 17 - name: Setup Gradle uses: gradle/gradle-build-action@v3.4.1 From 0bedc2355920e4b37f99d3f394365a4820d80d71 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sun, 16 Jun 2024 13:21:29 +0200 Subject: [PATCH 15/19] ###fix/Add feature extractors and test samples for SQLException - Removed Needs in forwardCompatibility - Should have resolved conflicts and rebased on main of Atrium --- .github/workflows/quality-assurance.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yml b/.github/workflows/quality-assurance.yml index 0d2a8ec706..aa4554a521 100644 --- a/.github/workflows/quality-assurance.yml +++ b/.github/workflows/quality-assurance.yml @@ -84,7 +84,6 @@ jobs: run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer forwardCompatibility: - needs: [] env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} From 657d32de5918ac61c4d7a3c49ecbc72fc44d2f7d Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sun, 16 Jun 2024 14:40:55 +0200 Subject: [PATCH 16/19] ###fix/Reset to earlier commit - Removed Needs in forwardCompatibility - Reset to earliet commit. --- .github/workflows/quality-assurance.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yml b/.github/workflows/quality-assurance.yml index 0d2a8ec706..aa4554a521 100644 --- a/.github/workflows/quality-assurance.yml +++ b/.github/workflows/quality-assurance.yml @@ -84,7 +84,6 @@ jobs: run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer forwardCompatibility: - needs: [] env: JAVA_VERSION: 17 KOTLIN_VERSION: ${{ matrix.kotlin_version }} From 77151481709c3a2f038f78318e3e20554f80dc12 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sun, 16 Jun 2024 15:31:05 +0200 Subject: [PATCH 17/19] ###fix/Update matrix generation with proper name pattern - Updated `matrix_builder.js` to ensure the `namePattern` is correctly set and used to generate meaningful names for the matrix rows. - Configured `matrix.js` to set the `namePattern` for generating the matrix rows, ensuring the `name` field is populated. --- .github/workflows/matrix.js | 8 +++++++- .github/workflows/matrix_builder.js | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/matrix.js b/.github/workflows/matrix.js index 21f414c3b9..9a0d1e28b1 100644 --- a/.github/workflows/matrix.js +++ b/.github/workflows/matrix.js @@ -5,13 +5,19 @@ const matrix = new MatrixBuilder(); matrix.addAxis({ name: 'os', title: x => x.replace('-latest', ''), - values: ['ubuntu-latest', 'windows-latest'] + values: [ + 'ubuntu-latest', + 'windows-latest' + ] }); matrix.addAxis({ name: 'java_version', values: ['11', '17'] }); +// Configure the order of the fields in job name +matrix.setNamePattern(['os', 'java_version']); + // Ensure at least one windows and at least one linux job is present (macos is almost the same as linux) matrix.generateRow({ os: 'windows-latest' }); matrix.generateRow({ os: 'ubuntu-latest' }); diff --git a/.github/workflows/matrix_builder.js b/.github/workflows/matrix_builder.js index 4cf2b8e5cb..a98ede8e6c 100644 --- a/.github/workflows/matrix_builder.js +++ b/.github/workflows/matrix_builder.js @@ -69,6 +69,7 @@ class MatrixBuilder { this.excludes = []; this.includes = []; this.failOnUnsatisfiableFilters = false; + // this.namePattern = []; // Initialize as an empty array } /** From ef22258571080d9a38e3f82ec5caaa82c51c908c Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sun, 16 Jun 2024 15:54:07 +0200 Subject: [PATCH 18/19] ###fix/Updated matrix generation with axis for Distribtuion - Updated `matrix.js` Axis contains: 'corretto', 'liberica', 'microsoft','temurin','zulu', --- .github/workflows/matrix.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/matrix.js b/.github/workflows/matrix.js index 9a0d1e28b1..18d4ff01f3 100644 --- a/.github/workflows/matrix.js +++ b/.github/workflows/matrix.js @@ -14,9 +14,20 @@ matrix.addAxis({ name: 'java_version', values: ['11', '17'] }); +matrix.addAxis({ + name: 'distribution', + title: x => x, + values: [ + 'corretto', + 'liberica', + 'microsoft', + 'temurin', + 'zulu' + ] +}); // Configure the order of the fields in job name -matrix.setNamePattern(['os', 'java_version']); +matrix.setNamePattern(['os', 'java_version', 'distribution']); // Ensure at least one windows and at least one linux job is present (macos is almost the same as linux) matrix.generateRow({ os: 'windows-latest' }); From 0fbadeae1af75f4de4a1eef37679e8cc47c8a699 Mon Sep 17 00:00:00 2001 From: BereKanters Date: Sun, 16 Jun 2024 16:00:36 +0200 Subject: [PATCH 19/19] ###fix/Updated matrix generation Axis name to right one - Updated `matrix.js` Axis contains: 'corretto', 'liberica', 'microsoft','temurin','zulu', --- .github/workflows/matrix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/matrix.js b/.github/workflows/matrix.js index 18d4ff01f3..bf5fcdef0a 100644 --- a/.github/workflows/matrix.js +++ b/.github/workflows/matrix.js @@ -15,7 +15,7 @@ matrix.addAxis({ values: ['11', '17'] }); matrix.addAxis({ - name: 'distribution', + name: 'java_distribution', title: x => x, values: [ 'corretto', @@ -27,7 +27,7 @@ matrix.addAxis({ }); // Configure the order of the fields in job name -matrix.setNamePattern(['os', 'java_version', 'distribution']); +matrix.setNamePattern(['os', 'java_version', 'java_distribution']); // Ensure at least one windows and at least one linux job is present (macos is almost the same as linux) matrix.generateRow({ os: 'windows-latest' });