[build] Disable parallel compilation on Windows and Ubuntu

This commit is contained in:
Him188 2022-11-22 09:55:55 +00:00
parent 4c8a18edb7
commit f7e138086b
2 changed files with 11 additions and 8 deletions

View File

@ -78,7 +78,7 @@ jobs:
- name: Build and Publish Local Artifacts
if: ${{ env.enableLocalPublishingTest == 'true' }}
run: ./gradlew :mirai-deps-test:publishMiraiLocalArtifacts ${{ env.gradleArgs }} "-Dmirai.build.project.version=2.99.0-deps-test"
run: ./gradlew :mirai-deps-test:publishMiraiLocalArtifacts ${{ env.gradleArgs }} "-Dmirai.build.project.version=2.99.0-deps-test" "-Porg.gradle.parallel=${{ matrix.parallelCompilation }}"
- name: Check Publication
if: ${{ env.enableLocalPublishingTest == 'true' }}
@ -97,14 +97,13 @@ jobs:
include:
- os: windows-2022
targetName: mingwX64
parallelCompilation: false
- os: ubuntu-20.04
targetName: linuxX64
- os: ubuntu-18.04
targetName: linuxX64
# - os: macos-12
# targetName: macosX64
- os: macos-11
parallelCompilation: false
- os: macos-12
targetName: macosX64
parallelCompilation: true # macOS machine has 14G
env:
# FIXME there must be two or more targets, or we'll get error on `@OptionalExpectation`
# > Declaration annotated with '@OptionalExpectation' can only be used in common module sources
@ -204,7 +203,7 @@ jobs:
- name: Build and Publish Local Artifacts
if: ${{ env.enableLocalPublishingTest == 'true' }}
run: ./gradlew :mirai-deps-test:publishMiraiLocalArtifacts ${{ env.gradleArgs }} "-Dmirai.build.project.version=2.99.0-deps-test"
run: ./gradlew :mirai-deps-test:publishMiraiLocalArtifacts ${{ env.gradleArgs }} "-Dmirai.build.project.version=2.99.0-deps-test" "-Porg.gradle.parallel=${{ matrix.parallelCompilation }}"
- name: Check Publication
if: ${{ env.enableLocalPublishingTest == 'true' }}

View File

@ -123,10 +123,13 @@ jobs:
include:
- os: windows-2022
targetName: mingwX64
parallelCompilation: false
- os: ubuntu-20.04
targetName: linuxX64
parallelCompilation: false
- os: macos-12
targetName: macosX64
parallelCompilation: true # macOS machine has 14G
env:
# FIXME there must be two or more targets, or we'll get error on `@OptionalExpectation`
# > Declaration annotated with '@OptionalExpectation' can only be used in common module sources
@ -230,8 +233,9 @@ jobs:
- name: Check keys
run: ./gradlew ensureMavenCentralAvailable ${{ env.gradleArgs }}
# Parallel compilation will exhaust machine memory causing OOM
- name: Assemble
run: ./gradlew assemble ${{ env.gradleArgs }}
run: ./gradlew assemble ${{ env.gradleArgs }} "-Porg.gradle.parallel=${{ matrix.parallelCompilation }}"
- name: Publish Local Artifacts
if: ${{ env.enableLocalPublishingTest == 'true' }}