mirror of
https://github.com/mamoe/mirai.git
synced 2026-08-22 06:03:32 +08:00
[build] Run only native tests for Release Publish to avoid OOM. Do not close repository because it always fails.
This commit is contained in:
70
.github/workflows/release.yml
vendored
70
.github/workflows/release.yml
vendored
@@ -21,9 +21,8 @@ jobs:
|
|||||||
os:
|
os:
|
||||||
- macos-12
|
- macos-12
|
||||||
env:
|
env:
|
||||||
enableLocalPublishingTest: 'false'
|
|
||||||
# All targets MUST be enabled. See #2270.
|
# All targets MUST be enabled. See #2270.
|
||||||
gradleArgs: --scan "-Dmirai.target=other" "-Pkotlin.compiler.execution.strategy=in-process" "-Dorg.gradle.jvmargs=-Xmx4096m" "-Dfile.encoding=UTF-8"
|
gradleArgs: --scan "-Dmirai.target=other" "-Pkotlin.compiler.execution.strategy=in-process"
|
||||||
isMac: ${{ startsWith(matrix.os, 'macos') }}
|
isMac: ${{ startsWith(matrix.os, 'macos') }}
|
||||||
isWindows: ${{ startsWith(matrix.os, 'windows') }}
|
isWindows: ${{ startsWith(matrix.os, 'windows') }}
|
||||||
isUbuntu: ${{ startsWith(matrix.os, 'ubuntu') }}
|
isUbuntu: ${{ startsWith(matrix.os, 'ubuntu') }}
|
||||||
@@ -123,17 +122,16 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: windows-2022
|
- os: windows-2022
|
||||||
targetName: mingwX64
|
targetName: mingwX64
|
||||||
parallelCompilation: false
|
# parallelCompilation: false
|
||||||
- os: ubuntu-20.04
|
- os: ubuntu-20.04
|
||||||
targetName: linuxX64
|
targetName: linuxX64
|
||||||
parallelCompilation: false
|
# parallelCompilation: false
|
||||||
- os: macos-12
|
- os: macos-12
|
||||||
targetName: macosX64
|
targetName: macosX64
|
||||||
parallelCompilation: true # macOS machine has 14G
|
# parallelCompilation: true # macOS machine has 14G
|
||||||
env:
|
env:
|
||||||
# FIXME there must be two or more targets, or we'll get error on `@OptionalExpectation`
|
# 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
|
# > Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||||
enableLocalPublishingTest: 'false'
|
|
||||||
gradleArgs: --scan "-Dmirai.target=jvm;${{ matrix.targetName }};~other" "-Pkotlin.compiler.execution.strategy=in-process" "-Dorg.gradle.jvmargs=-Xmx4096m" "-Dfile.encoding=UTF-8"
|
gradleArgs: --scan "-Dmirai.target=jvm;${{ matrix.targetName }};~other" "-Pkotlin.compiler.execution.strategy=in-process" "-Dorg.gradle.jvmargs=-Xmx4096m" "-Dfile.encoding=UTF-8"
|
||||||
isMac: ${{ startsWith(matrix.os, 'macos') }}
|
isMac: ${{ startsWith(matrix.os, 'macos') }}
|
||||||
isWindows: ${{ startsWith(matrix.os, 'windows') }}
|
isWindows: ${{ startsWith(matrix.os, 'windows') }}
|
||||||
@@ -233,18 +231,18 @@ jobs:
|
|||||||
- name: Check keys
|
- name: Check keys
|
||||||
run: ./gradlew ensureMavenCentralAvailable ${{ env.gradleArgs }}
|
run: ./gradlew ensureMavenCentralAvailable ${{ env.gradleArgs }}
|
||||||
|
|
||||||
# Parallel compilation will exhaust machine memory causing OOM
|
- name: "Test mirai-core-utils for ${{ matrix.os }}"
|
||||||
- name: Assemble
|
run: ./gradlew :mirai-core-utils:${{ matrix.targetName }}Test ${{ env.gradleArgs }}
|
||||||
run: ./gradlew assemble ${{ env.gradleArgs }} "-Porg.gradle.parallel=${{ matrix.parallelCompilation }}"
|
|
||||||
|
|
||||||
- name: Publish Local Artifacts
|
- name: "Test mirai-core-api for ${{ matrix.os }}"
|
||||||
if: ${{ env.enableLocalPublishingTest == 'true' }}
|
run: ./gradlew :mirai-core-api:${{ matrix.targetName }}Test ${{ env.gradleArgs }}
|
||||||
run: ./gradlew :mirai-deps-test:publishMiraiArtifactsToMavenLocal ${{ env.gradleArgs }} "-Dmirai.build.project.version=2.99.0-deps-test"
|
|
||||||
|
|
||||||
- name: Check
|
- name: "Test mirai-core for ${{ matrix.os }}"
|
||||||
run: ./gradlew check ${{ env.gradleArgs }}
|
run: ./gradlew :mirai-core:${{ matrix.targetName }}Test ${{ env.gradleArgs }}
|
||||||
|
|
||||||
# Publish native snapshots. Other artifacts are published in publish-mirai-all
|
# # Parallel compilation will exhaust machine memory causing OOM
|
||||||
|
# - name: Assemble
|
||||||
|
# run: ./gradlew assemble ${{ env.gradleArgs }} "-Porg.gradle.parallel=${{ matrix.parallelCompilation }}"
|
||||||
|
|
||||||
- name: Publish MingwX64
|
- name: Publish MingwX64
|
||||||
if: ${{ env.isWindows == 'true' }}
|
if: ${{ env.isWindows == 'true' }}
|
||||||
@@ -257,24 +255,24 @@ jobs:
|
|||||||
- name: Publish macOSX64
|
- name: Publish macOSX64
|
||||||
if: ${{ env.isMac == 'true' }}
|
if: ${{ env.isMac == 'true' }}
|
||||||
run: ./gradlew publishMacosX64PublicationToMavenCentralRepository ${{ env.gradleArgs }}
|
run: ./gradlew publishMacosX64PublicationToMavenCentralRepository ${{ env.gradleArgs }}
|
||||||
|
#
|
||||||
close-repository:
|
# close-repository:
|
||||||
runs-on: macos-12
|
# runs-on: macos-12
|
||||||
needs:
|
# needs:
|
||||||
- publish-others
|
# - publish-others
|
||||||
- publish-core-native
|
# - publish-core-native
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v2
|
# - uses: actions/checkout@v2
|
||||||
with:
|
# with:
|
||||||
submodules: 'recursive'
|
# submodules: 'recursive'
|
||||||
|
#
|
||||||
- uses: actions/setup-java@v2
|
# - uses: actions/setup-java@v2
|
||||||
with:
|
# with:
|
||||||
distribution: 'adopt-openj9'
|
# distribution: 'adopt-openj9'
|
||||||
java-version: '17'
|
# java-version: '17'
|
||||||
|
#
|
||||||
- name: Setup Gradle
|
# - name: Setup Gradle
|
||||||
uses: gradle/gradle-build-action@v2
|
# uses: gradle/gradle-build-action@v2
|
||||||
|
#
|
||||||
- name: Close repository
|
# - name: Close repository
|
||||||
run: ./gradlew :ci-release-helper:closeRepository --scan
|
# run: ./gradlew :ci-release-helper:closeRepository --scan
|
||||||
Reference in New Issue
Block a user