diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index 1b7822246..048285c71 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -6,13 +6,18 @@ jobs: publish: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # setup build environment - - uses: coursier/cache-action@v5 - - uses: olafurpg/setup-scala@v12 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 8 + cache: sbt + - uses: sbt/setup-sbt@v1 # this setup is all for the github pages deployment to work - name: install sphinx diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ea0099ec..bc045cf7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,13 +6,18 @@ jobs: publish: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # setup build environment - - uses: coursier/cache-action@v5 - - uses: olafurpg/setup-scala@v12 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 8 + cache: sbt + - uses: sbt/setup-sbt@v1 - run: sbt ci-release env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 3ec6147ad..76722f42e 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -2,299 +2,115 @@ name: Validate PR on: pull_request: + push: jobs: + # Run the unit test ahead of the scripted tests validate: - - runs-on: ubuntu-latest strategy: fail-fast: false - - steps: - - uses: actions/checkout@v2 - - - name: "Running shasum for cache invalidation" - run: | - shasum build.sbt \ - project/plugins.sbt \ - project/build.properties > gha.cache.tmp - - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('gha.cache.tmp') }} - restore-keys: | - ${{ runner.os }}-ivy- - - - name: Loading coursier cache - uses: actions/cache@v1 - with: - path: ~/.cache/coursier - key: ${{ runner.os }}-coursier-${{ hashFiles('gha.cache.tmp') }} - restore-keys: | - ${{ runner.os }}-coursier- - - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - - name: Validate - run: sbt "^validate" - - scripted-universal: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateUniversal" - - scripted-jar: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] + matrix: + include: + - os: ubuntu-latest + - os: macos-latest + runs-on: '${{ matrix.os }}' steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateJar" - - scripted-bash: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateBash" - - scripted-ash: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateAsh" - - scripted-rpm: - runs-on: ubuntu-latest + - uses: actions/checkout@v4 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 8 + cache: sbt + - uses: sbt/setup-sbt@v1 + - name: Validate + run: sbt -v "+validate" + + scripted: strategy: fail-fast: false - needs: [ validate ] + matrix: + include: + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateUniversal + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateJar + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateBash + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateAsh + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateRpm + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateDebian + - os: ubuntu-latest + java: 8 + distribution: zulu + command: +validateDocker + - os: ubuntu-latest + java: 11 + distribution: temurin + command: +validateJlink + - os: ubuntu-latest + java: 22 + distribution: graalvm + command: +validateGraalVMNativeImage + - os: macos-latest + java: 8 + distribution: zulu + command: +validateMacOS + - os: windows-latest + java: 8 + distribution: zulu + command: +validateWindows + needs: + - validate + runs-on: '${{ matrix.os }}' steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateRpm" + - uses: actions/checkout@v4 + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: '${{ matrix.distribution }}' + java-version: '${{ matrix.java }}' + cache: sbt + - uses: sbt/setup-sbt@v1 + - name: Scritped test + run: sbt -v '${{ matrix.command }}' - scripted-debian: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateDebian" - scripted-jdk-packager: runs-on: ubuntu-latest strategy: fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - # the standard zulu dist doesn't include javafx - java-version: zulu@1.8=tgz+https://cdn.azul.com/zulu/bin/zulu8.38.0.13-ca-fx-jdk8.0.212-linux_x64.tar.gz - - name: Validate - run: sbt "^validateJdkPackagerTravis" - - scripted-docker: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validateDocker" - - scripted-jlink: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up JDK 1.11.0-2 - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.11 - - name: Validate - run: sbt "^validateJlink" - - - scripted-graavlvm: - runs-on: ubuntu-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Setup GraalVM environment - uses: olafurpg/setup-scala@v10 - with: - java-version: graalvm@22.3.3=tgz+https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-amd64-22.3.3.tar.gz - - name: Install native-image - run: gu install native-image - - name: Validate - run: sbt "^validateGraalVMNativeImage" - - scripted-macos: - runs-on: macos-latest - strategy: - fail-fast: false - needs: [ validate ] - steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt "^validate" "^validateMacOS" - - scripted-windows: - runs-on: windows-latest - strategy: - fail-fast: false - needs: [ validate ] + needs: + - validate steps: - - uses: actions/checkout@v2 - - name: Loading ivy cache - uses: actions/cache@v1 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-ivy-${{ hashFiles('**/*.sbt') }} - restore-keys: | - ${{ runner.os }}-ivy- - - name: Set up Azul JDK 1.8 and SBT - uses: olafurpg/setup-scala@v10 - with: - java-version: zulu@1.8 - - name: Validate - run: sbt validateWindows + - uses: actions/checkout@v4 + - name: Download Zulu 8 + run: | + # the standard zulu dist doesn't include javafx + download_url="https://cdn.azul.com/zulu/bin/zulu8.38.0.13-ca-fx-jdk8.0.212-linux_x64.tar.gz" + wget -O $RUNNER_TEMP/java_package.tar.gz $download_url + - name: Setup Azul JDK with JavaFX + uses: actions/setup-java@v4 + with: + distribution: jdkfile + jdkFile: '${{ runner.temp }}/java_package.tar.gz' + java-version: 8.0.0 + architecture: x64 + cache: sbt + - uses: sbt/setup-sbt@v1 + - name: Validate + run: sbt "+validateJdkPackagerTravis" diff --git a/build.sbt b/build.sbt index 3d81d0e1d..705bc72df 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,18 @@ Global / onChangedBuildSource := ReloadOnSourceChanges Global / scalaVersion := "2.12.20" // crossBuildingSettings -crossSbtVersions := Vector("1.1.6") +(pluginCrossBuild / sbtVersion) := { + scalaBinaryVersion.value match { + case "2.12" => "1.1.6" + case _ => "2.0.0-M2" + } +} +scriptedSbt := { + scalaBinaryVersion.value match { + case "2.12" => "1.10.5" + case _ => "2.0.0-M2" + } +} Compile / scalacOptions ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") diff --git a/src/sbt-test/debian/native-build-compress/build.sbt b/src/sbt-test/debian/native-build-compress/build.sbt index 715c379f9..b2d57aa5b 100644 --- a/src/sbt-test/debian/native-build-compress/build.sbt +++ b/src/sbt-test/debian/native-build-compress/build.sbt @@ -1,3 +1,5 @@ +name := "foo" + enablePlugins(DebianPlugin) Debian / debianNativeBuildOptions := Nil diff --git a/src/sbt-test/debian/native-build-default/build.sbt b/src/sbt-test/debian/native-build-default/build.sbt index 81bad003c..3941a8ea0 100644 --- a/src/sbt-test/debian/native-build-default/build.sbt +++ b/src/sbt-test/debian/native-build-default/build.sbt @@ -1,3 +1,5 @@ +name := "foo" + enablePlugins(DebianPlugin) maintainer := "Maintainer "