mirror of
https://github.com/sbt/sbt.git
synced 2026-09-05 17:25:23 +02:00
Merge branch '1.11.x' into wip/merge-1.11.x
This commit is contained in:
@@ -36,18 +36,6 @@ jobs:
|
||||
# java: 8
|
||||
# distribution: zulu
|
||||
# jobtype: 6
|
||||
- os: ubuntu-latest
|
||||
java: 8
|
||||
distribution: zulu
|
||||
jobtype: 7
|
||||
- os: macos-latest
|
||||
java: 17
|
||||
distribution: temurin
|
||||
jobtype: 8
|
||||
- os: windows-latest
|
||||
java: 8
|
||||
distribution: zulu
|
||||
jobtype: 9
|
||||
- os: ubuntu-latest
|
||||
java: 11
|
||||
distribution: temurin
|
||||
@@ -99,22 +87,13 @@ jobs:
|
||||
with:
|
||||
distribution: "${{ matrix.distribution }}"
|
||||
java-version: "${{ matrix.java }}"
|
||||
cache: "sbt"
|
||||
- name: Setup sbt
|
||||
uses: sbt/setup-sbt@v1
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12
|
||||
- name: Coursier cache
|
||||
uses: coursier/cache-action@v6
|
||||
# - name: Cache sbt
|
||||
# uses: actions/cache@v3
|
||||
# with:
|
||||
# path: ~/.sbt
|
||||
# key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
|
||||
- name: Setup Windows C++ toolchain
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
if: ${{ matrix.os == 'windows-2019' }}
|
||||
- name: Pre-test cleanup
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -185,47 +164,6 @@ jobs:
|
||||
# sbt -Dsbtzinc.path=$HOME/work/sbt/sbt/zinc -Dsbt.build.version=$BUILD_VERSION -Dsbt.build.fatal=false "+lowerUtils/publishLocal; {zinc}/publishLocal; upperModules/publishLocal"
|
||||
# rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
|
||||
# sbt -v -Dsbt.version=$BUILD_VERSION "++$SCALA_213; all $UTIL_TESTS; ++$SCALA_212; all $UTIL_TESTS; scripted actions/* source-dependencies/*1of3 dependency-management/*1of4 java/*"
|
||||
- name: Build and test (7)
|
||||
if: ${{ matrix.jobtype == 7 }}
|
||||
shell: bash
|
||||
run: |
|
||||
# test building sbtn on Linux
|
||||
sbt "-Dsbt.io.virtual=false" nativeImage
|
||||
# test launcher script
|
||||
echo build using JDK 8 test using JDK 8 and JDK 11
|
||||
cd launcher-package
|
||||
sbt -Dsbt.build.version=$TEST_SBT_VER rpm:packageBin debian:packageBin
|
||||
sbt -Dsbt.build.version=$TEST_SBT_VER integrationTest/test
|
||||
cd citest && ./test.sh
|
||||
$HOME/bin/jabba install $JDK11 && exec $HOME/bin/jabba which --home $JDK11
|
||||
java -Xmx32m -version
|
||||
./test.sh
|
||||
- name: Build and test (8)
|
||||
if: ${{ matrix.jobtype == 8 }}
|
||||
shell: bash
|
||||
run: |
|
||||
# test building sbtn on macOS
|
||||
./sbt "-Dsbt.io.virtual=false" nativeImage
|
||||
# test launcher script
|
||||
cd launcher-package
|
||||
bin/coursier resolve
|
||||
../sbt -Dsbt.build.version=$TEST_SBT_VER integrationTest/test
|
||||
# This fails due to the JLine issue
|
||||
# cd citest && ./test.sh
|
||||
- name: Build and test (9)
|
||||
if: ${{ matrix.jobtype == 9 }}
|
||||
shell: bash
|
||||
run: |
|
||||
# test building sbtn on Windows
|
||||
sbt "-Dsbt.io.virtual=false" nativeImage
|
||||
# test launcher script
|
||||
echo build using JDK 8, test using JDK 8, on Windows
|
||||
cd launcher-package
|
||||
bin/coursier.bat resolve
|
||||
sbt -Dsbt.build.version=$TEST_SBT_VER integrationTest/test
|
||||
cd citest
|
||||
./test.bat
|
||||
test3/test3.bat
|
||||
- name: Build and test lm-coursier (10)
|
||||
if: ${{ matrix.jobtype == 10 }}
|
||||
shell: bash
|
||||
@@ -237,13 +175,3 @@ jobs:
|
||||
find **/src/main/contraband-scala -name "*.scala" -delete || true
|
||||
sbt generateContrabands
|
||||
git diff --exit-code
|
||||
- name: Cleanup
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf "$HOME/.sbt/scripted/" || true
|
||||
rm -rf "$HOME/.ivy2/local" || true
|
||||
rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
|
||||
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
|
||||
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
|
||||
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
|
||||
find $HOME/.sbt -name "*.lock" -delete || true
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Clean
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
delete-artifacts:
|
||||
name: Delete Artifacts
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Delete artifacts
|
||||
shell: bash {0}
|
||||
run: |
|
||||
# Customize those three lines with your repository and credentials:
|
||||
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
|
||||
|
||||
# A shortcut to call GitHub API.
|
||||
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
|
||||
|
||||
# A temporary file which receives HTTP response headers.
|
||||
TMPFILE=$(mktemp)
|
||||
|
||||
# An associative array, key: artifact name, value: number of artifacts of that name.
|
||||
declare -A ARTCOUNT
|
||||
|
||||
# Process all artifacts on this repository, loop on returned "pages".
|
||||
URL=$REPO/actions/artifacts
|
||||
while [[ -n "$URL" ]]; do
|
||||
|
||||
# Get current page, get response headers in a temporary file.
|
||||
JSON=$(ghapi --dump-header $TMPFILE "$URL")
|
||||
|
||||
# Get URL of next page. Will be empty if we are at the last page.
|
||||
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
|
||||
rm -f $TMPFILE
|
||||
|
||||
# Number of artifacts on this page:
|
||||
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
|
||||
|
||||
# Loop on all artifacts on this page.
|
||||
for ((i=0; $i < $COUNT; i++)); do
|
||||
|
||||
# Get name of artifact and count instances of this name.
|
||||
name=$(jq <<<$JSON -r ".artifacts[$i].name?")
|
||||
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
|
||||
|
||||
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
|
||||
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
|
||||
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
|
||||
ghapi -X DELETE $REPO/actions/artifacts/$id
|
||||
done
|
||||
done
|
||||
@@ -0,0 +1,92 @@
|
||||
name: Client Test
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
java: 8
|
||||
distribution: zulu
|
||||
- os: macos-latest
|
||||
java: 17
|
||||
distribution: temurin
|
||||
- os: windows-latest
|
||||
java: 8
|
||||
distribution: zulu
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
JAVA_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
|
||||
JVM_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
|
||||
SBT_ETC_FILE: $HOME/etc/sbt/sbtopts
|
||||
TEST_SBT_VER: 1.11.4
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: "zulu"
|
||||
java-version: "8"
|
||||
cache: sbt
|
||||
- uses: sbt/setup-sbt@v1
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12
|
||||
- name: Setup Windows C++ toolchain
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
- name: Client test (Linux)
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
shell: bash
|
||||
run: |
|
||||
# test building sbtn on Linux
|
||||
sbt "-Dsbt.io.virtual=false" nativeImage
|
||||
# smoke test native Image
|
||||
./client/target/bin/sbtn --sbt-script=$(pwd)/sbt about
|
||||
./client/target/bin/sbtn --sbt-script=$(pwd)/sbt shutdown
|
||||
# test launcher script
|
||||
echo build using JDK 8 test using JDK 8 and JDK 11
|
||||
cd launcher-package
|
||||
sbt -Dsbt.build.version=$TEST_SBT_VER rpm:packageBin debian:packageBin
|
||||
sbt -Dsbt.build.version=$TEST_SBT_VER integrationTest/test
|
||||
cd citest && ./test.sh
|
||||
$HOME/bin/jabba install $JDK11 && exec $HOME/bin/jabba which --home $JDK11
|
||||
java -Xmx32m -version
|
||||
./test.sh
|
||||
- name: Client test (macOS)
|
||||
if: ${{ matrix.os == 'macos-latest' }}
|
||||
shell: bash
|
||||
run: |
|
||||
# test building sbtn on macOS
|
||||
./sbt "-Dsbt.io.virtual=false" nativeImage
|
||||
# test launcher script
|
||||
cd launcher-package
|
||||
bin/coursier resolve
|
||||
../sbt -Dsbt.build.version=$TEST_SBT_VER integrationTest/test
|
||||
# This fails due to the JLine issue
|
||||
# cd citest && ./test.sh
|
||||
- name: Client test (Windows)
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
shell: bash
|
||||
run: |
|
||||
# test building sbtn on Windows
|
||||
sbt "-Dsbt.io.virtual=false" nativeImage
|
||||
# smoke test native Image
|
||||
./client/target/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat about
|
||||
./client/target/bin/sbtn --sbt-script=$(pwd)/launcher-package/src/universal/bin/sbt.bat shutdown
|
||||
# test launcher script
|
||||
echo build using JDK 8, test using JDK 8, on Windows
|
||||
cd launcher-package
|
||||
bin/coursier.bat resolve
|
||||
sbt -Dsbt.build.version=$TEST_SBT_VER integrationTest/test
|
||||
cd citest
|
||||
./test.bat
|
||||
test3/test3.bat
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Server Test
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
|
||||
JVM_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
|
||||
SBT_ETC_FILE: $HOME/etc/sbt/sbtopts
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: "zulu"
|
||||
java-version: "8"
|
||||
cache: sbt
|
||||
- uses: sbt/setup-sbt@v1
|
||||
- name: Server test
|
||||
shell: bash
|
||||
run: sbt -v --client "serverTestProj/test"
|
||||
Reference in New Issue
Block a user