diff --git a/.editorconfig b/.editorconfig index 61ae15b9cb..7cb159bd14 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ trim_trailing_whitespace = true [*.md] insert_final_newline = false trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 diff --git a/.github/.codecov.yml b/.github/.codecov.yml index 19b0553365..966cdfa3fe 100644 --- a/.github/.codecov.yml +++ b/.github/.codecov.yml @@ -1,36 +1,20 @@ ignore: - - "misc/specs" - - "misc/tools" - - "samples" - - #TODO remove all below with 1.0.0 - - "misc/verb/**/atrium/verbs/**/*" - - "misc/deprecated/atrium-assertions" - - "misc/deprecated/atrium-spec" - - "misc/deprecated/domain/api/**/assertions/**/*" - - "misc/deprecated/domain/atrium-domain-api-deprecated" - - "misc/deprecated/domain/builders/**/AssertImpl.kt" - - "misc/deprecated/domain/builders/**/ExpectImpl.kt" - - "misc/deprecated/domain/builders/**/ExpectImplExtensions.kt" - - "misc/deprecated/domain/builders/**/creating/*AssertionsBuilder.kt" - - "misc/deprecated/domain/builders/**/creating/*AssertionsBuilders.kt" - - "misc/deprecated/domain/builders/**/utils/nullable.kt" - - "misc/deprecated/domain/builders/**/utils/subAssert.kt" - - "**/IAtriumFactory.kt" - - "**/AtriumFactory.kt" + - "misc/specs" + - "misc/tools" + - "samples" coverage: - range: 70..95 - status: - project: - default: - target: 85% - patch: - default: - target: 85% + range: 70..95 + status: + project: + default: + target: 85% + patch: + default: + target: 85% codecov: - notify: - after_n_builds: 8 -comment: + notify: after_n_builds: 8 +comment: + after_n_builds: 8 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6fd6c5c3d1..8404dff74c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,42 +1,42 @@ version: 2 updates: -- package-ecosystem: gradle - directory: "/samples/js/" - schedule: + - package-ecosystem: gradle + directory: "/samples/js/" + schedule: interval: daily time: "04:00" - open-pull-requests-limit: 10 - labels: + open-pull-requests-limit: 10 + labels: - "dependencies" -- package-ecosystem: gradle - directory: "/samples/jvm/junit5" - schedule: - interval: daily - time: "04:00" - open-pull-requests-limit: 10 - labels: - - "dependencies" -- package-ecosystem: gradle - directory: "/samples/jvm/spek" - schedule: - interval: daily - time: "04:00" - open-pull-requests-limit: 10 - labels: + - package-ecosystem: gradle + directory: "/samples/jvm/junit5" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 + labels: + - "dependencies" + - package-ecosystem: gradle + directory: "/samples/jvm/spek" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 + labels: - "dependencies" -- package-ecosystem: maven - directory: "/samples/maven" - schedule: + - package-ecosystem: maven + directory: "/samples/maven" + schedule: interval: daily time: "04:00" - open-pull-requests-limit: 10 - labels: + open-pull-requests-limit: 10 + labels: - "dependencies" -- package-ecosystem: gradle - directory: "/samples/multiplatform" - schedule: + - package-ecosystem: gradle + directory: "/samples/multiplatform" + schedule: interval: daily time: "04:00" - open-pull-requests-limit: 10 - labels: + open-pull-requests-limit: 10 + labels: - "dependencies" diff --git a/.github/workflows/bbc-ubuntu.yml b/.github/workflows/bbc-ubuntu.yml index d4eb022a38..b8e5b2ac65 100644 --- a/.github/workflows/bbc-ubuntu.yml +++ b/.github/workflows/bbc-ubuntu.yml @@ -1,28 +1,28 @@ name: Binary Backward Compatibility -on: [push, pull_request] +on: [ push, pull_request ] jobs: - build: - env: - JAVA_VERSION: '11' - runs-on: ubuntu-latest + build: + env: + JAVA_VERSION: '11' + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v1 - with: - java-version: ${{env.JAVA_VERSION}} + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK ${{ matrix.java_version }}" + uses: actions/setup-java@v1 + with: + java-version: ${{env.JAVA_VERSION}} - - name: bbcTests - run: ./gradlew bbcTests + - name: bbcTests + run: ./gradlew bbcTests - - name: Upload windows build code coverage - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: bbc - env_vars: JAVA_VERSION - # too many timeout errors, let's not fail at the moment - #fail_ci_if_error: true + - name: Upload windows build code coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: bbc + env_vars: JAVA_VERSION + # too many timeout errors, let's not fail at the moment + #fail_ci_if_error: true diff --git a/.github/workflows/bc-ubuntu.yml b/.github/workflows/bc-ubuntu.yml index b386761a3d..a3b784fa80 100644 --- a/.github/workflows/bc-ubuntu.yml +++ b/.github/workflows/bc-ubuntu.yml @@ -1,28 +1,28 @@ name: Source Backward Compatibility -on: [push, pull_request] +on: [ push, pull_request ] jobs: - build: - env: - JAVA_VERSION: '11' - runs-on: ubuntu-latest + build: + env: + JAVA_VERSION: '11' + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v1 - with: - java-version: ${{env.JAVA_VERSION}} + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK ${{ matrix.java_version }}" + uses: actions/setup-java@v1 + with: + java-version: ${{env.JAVA_VERSION}} - - name: bcTests - run: ./gradlew bcTests + - name: bcTests + run: ./gradlew bcTests - - name: Upload windows build code coverage - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: bc - env_vars: JAVA_VERSION - # too many timeout errors, let's not fail at the moment - #fail_ci_if_error: true + - name: Upload windows build code coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: bc + env_vars: JAVA_VERSION + # too many timeout errors, let's not fail at the moment + #fail_ci_if_error: true diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index b444018b7e..a8a45cb122 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -1,45 +1,45 @@ name: Ubuntu -on: [push, pull_request] +on: [ push, pull_request ] jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - java_version: [9, 11, 14] - - steps: - - uses: actions/checkout@v2 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java_version }} - - - name: build - run: ./gradlew build - -# TODO 0.16.0 or 0.17.0 re-activate scala API -# - name: composite build atrium-scala2 -# run: ./gradlew build -# working-directory: misc/tools/atrium-scala2-test - - - name: Upload windows build code coverage - uses: codecov/codecov-action@v1 - env: - JAVA_VERSION: ${{ matrix.java_version }} - 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: composite build atrium-samples-test - run: ./gradlew build - working-directory: misc/tools/atrium-samples-test - - - name: composite build atrium-js-sample-test - run: ./gradlew build - working-directory: misc/tools/atrium-js-sample-test + build: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + java_version: [ 9, 11, 14 ] + + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK ${{ matrix.java_version }}" + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java_version }} + + - name: build + run: ./gradlew build + + # TODO 0.16.0 or 0.17.0 re-activate scala API + # - name: composite build atrium-scala2 + # run: ./gradlew build + # working-directory: misc/tools/atrium-scala2-test + + - name: Upload windows build code coverage + uses: codecov/codecov-action@v1 + env: + JAVA_VERSION: ${{ matrix.java_version }} + 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: composite build atrium-samples-test + run: ./gradlew build + working-directory: misc/tools/atrium-samples-test + + - name: composite build atrium-js-sample-test + run: ./gradlew build + working-directory: misc/tools/atrium-js-sample-test diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 07b34fe3ef..1a2a90ceef 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -1,72 +1,72 @@ name: Windows -on: [push, pull_request] +on: [ push, pull_request ] jobs: - build: - env: - android-version: 26 - runs-on: windows-latest - strategy: - fail-fast: true - matrix: - java_version: [9, 11, 14] + build: + env: + android-version: 26 + runs-on: windows-latest + strategy: + fail-fast: true + matrix: + java_version: [ 9, 11, 14 ] - steps: - - uses: actions/checkout@v2 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java_version }} + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK ${{ matrix.java_version }}" + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java_version }} - - name: build - run: ./gradlew build + - name: build + run: ./gradlew build - - name: Cache android jar - id: android-cache - uses: actions/cache@v1 - with: - path: android-jar-cache - key: ${{ runner.os }}-android-version-${{ env.android-version }} + - name: Cache android jar + id: android-cache + uses: actions/cache@v1 + 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: | - md 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" - $file_sha256 = $(certutil -hashfile android.jar sha256)[1] -replace " ","" - $expected_sha256 = "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa" - if ($file_sha256 -Ne $expected_sha256) { - echo "wrong sha256 for android.jar: $file_sha256"; - echo " expected: $expected_sha256"; - exit -1 - } + - name: download Android SDK's android.jar (or use cached file) + if: steps.android-cache.outputs.cache-hit != 'true' + run: | + md 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" + $file_sha256 = $(certutil -hashfile android.jar sha256)[1] -replace " ","" + $expected_sha256 = "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa" + if ($file_sha256 -Ne $expected_sha256) { + echo "wrong sha256 for android.jar: $file_sha256"; + echo " expected: $expected_sha256"; + exit -1 + } - - name: check Atrium's -android.jar can be dexed - run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer - shell: bash + - name: check Atrium's -android.jar can be dexed + run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer + shell: bash -# TODO 0.16.0 or 0.17.0 re-activate scala API -# - name: composite build atrium-scala2 -# run: ./gradlew build -# working-directory: misc\tools\atrium-scala2-test + # TODO 0.16.0 or 0.17.0 re-activate scala API + # - name: composite build atrium-scala2 + # run: ./gradlew build + # working-directory: misc\tools\atrium-scala2-test - - name: Upload windows build code coverage - uses: codecov/codecov-action@v1 - env: - JAVA_VERSION: ${{ matrix.java_version }} - 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 + - name: Upload windows build code coverage + uses: codecov/codecov-action@v1 + env: + JAVA_VERSION: ${{ matrix.java_version }} + 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 - - name: composite build atrium-samples-test - run: ./gradlew build - working-directory: misc\tools\atrium-samples-test + - name: composite build atrium-samples-test + run: ./gradlew build + working-directory: misc\tools\atrium-samples-test - - name: composite build atrium-js-sample-test - run: ./gradlew build - working-directory: misc\tools\atrium-js-sample-test + - name: composite build atrium-js-sample-test + run: ./gradlew build + working-directory: misc\tools\atrium-js-sample-test diff --git a/.github/workflows/check-generated-committed.yml b/.github/workflows/check-generated-committed.yml index 8ecb057dab..588eddb442 100644 --- a/.github/workflows/check-generated-committed.yml +++ b/.github/workflows/check-generated-committed.yml @@ -1,27 +1,27 @@ name: Check Generated on: - push: - paths: - - 'logic/**/main/**/*Assertions.kt' - pull_request: - paths: - - 'logic/**/main/**/*Assertions.kt' + push: + paths: + - 'logic/**/main/**/*Assertions.kt' + pull_request: + paths: + - 'logic/**/main/**/*Assertions.kt' jobs: - build: - runs-on: windows-latest - strategy: - fail-fast: true - matrix: - java_version: [11] - steps: - - uses: actions/checkout@v2 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java_version }} + build: + runs-on: windows-latest + strategy: + fail-fast: true + matrix: + java_version: [ 11 ] + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK ${{ matrix.java_version }}" + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java_version }} - - name: check generateLogic committed - run: ./gradle/scripts/check-generateLogic-committed.sh - shell: bash + - 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 new file mode 100644 index 0000000000..1c9dbd5c2e --- /dev/null +++ b/.github/workflows/generate-readme-examples.yml @@ -0,0 +1,24 @@ +name: Generate README examples + +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK 11" + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Generate readme + run: ./gradlew :readme-examples + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + branch: generate-readme + title: Generate README examples + commit-message: generate README examples + delete-branch: true + diff --git a/.github/workflows/samples-windows.yml b/.github/workflows/samples-windows.yml index b7765f3bc9..6340a099fe 100644 --- a/.github/workflows/samples-windows.yml +++ b/.github/workflows/samples-windows.yml @@ -1,59 +1,59 @@ name: Samples on: - push: - paths: - - 'samples/**' - pull_request: - paths: - - 'samples/**' + push: + paths: + - 'samples/**' + pull_request: + paths: + - 'samples/**' jobs: - build: - runs-on: windows-latest - strategy: - fail-fast: true - matrix: - java_version: [9, 11, 14] - - steps: - - uses: actions/checkout@v2 - - name: "Set up JDK ${{ matrix.java_version }}" - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java_version }} - - - name: Cache maven dependencies - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: samples-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - samples-${{ runner.os }}-maven- - - - name: build js sample - run: ./gradlew build - working-directory: samples\js - - - name: build Spek sample - run: ./gradlew build - working-directory: samples\jvm\spek - - - name: build Junit5 sample - run: ./gradlew build - working-directory: samples\jvm\junit5 - - - name: build MPP sample - run: ./gradlew build - working-directory: samples\multiplatform - - # Kotlin does not yet support to generate jdk 14 byte code - - name: determine kotlin compile target - run: | - export KOTLIN_TARGET=$(if [ "${{ matrix.java_version }}" -eq "14" ]; then echo "13"; else echo "${{ matrix.java_version }}"; fi) - echo "KOTLIN_TARGET=$KOTLIN_TARGET" >> $GITHUB_ENV - shell: bash - - - name: build maven sample - run: ./mvnw -B clean verify "-Djava.version=${{ env.KOTLIN_TARGET }}" - working-directory: samples/maven + build: + runs-on: windows-latest + strategy: + fail-fast: true + matrix: + java_version: [ 9, 11, 14 ] + + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK ${{ matrix.java_version }}" + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java_version }} + + - name: Cache maven dependencies + uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: samples-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + samples-${{ runner.os }}-maven- + + - name: build js sample + run: ./gradlew build + working-directory: samples\js + + - name: build Spek sample + run: ./gradlew build + working-directory: samples\jvm\spek + + - name: build Junit5 sample + run: ./gradlew build + working-directory: samples\jvm\junit5 + + - name: build MPP sample + run: ./gradlew build + working-directory: samples\multiplatform + + # Kotlin does not yet support to generate jdk 14 byte code + - name: determine kotlin compile target + run: | + export KOTLIN_TARGET=$(if [ "${{ matrix.java_version }}" -eq "14" ]; then echo "13"; else echo "${{ matrix.java_version }}"; fi) + echo "KOTLIN_TARGET=$KOTLIN_TARGET" >> $GITHUB_ENV + shell: bash + + - name: build maven sample + run: ./mvnw -B clean verify "-Djava.version=${{ env.KOTLIN_TARGET }}" + working-directory: samples/maven diff --git a/.github/workflows/validate-gradle-wrapper.yml b/.github/workflows/validate-gradle-wrapper.yml index cbf839cf47..f247eb57f8 100644 --- a/.github/workflows/validate-gradle-wrapper.yml +++ b/.github/workflows/validate-gradle-wrapper.yml @@ -1,10 +1,10 @@ name: "Validate Gradle Wrapper" -on: [push, pull_request] +on: [ push, pull_request ] jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: gradle/wrapper-validation-action@v1 + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1