Skip to content

Commit

Permalink
Test stdlib-bootstrapped TASTy-MiMa in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Jul 7, 2023
1 parent da80053 commit fea4f47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ jobs:
run: |
./project/scripts/sbt ";scala3-interfaces/mimaReportBinaryIssues ;scala3-library-bootstrapped/mimaReportBinaryIssues ;scala3-library-bootstrappedJS/mimaReportBinaryIssues; tasty-core-bootstrapped/mimaReportBinaryIssues; stdlib-bootstrapped/mimaReportBinaryIssues"
- name: TASTy MiMa
run: |
# This script cleans the compiler and recompiles it from scratch (keep as last run)
./project/scripts/stdlib-bootstrapped-tasty-mima.sh
community_build_a:
runs-on: [self-hosted, Linux]
container:
Expand Down
22 changes: 22 additions & 0 deletions project/scripts/stdlib-bootstrapped-tasty-mima.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -eux

source $(dirname $0)/cmdTestsCommon.inc.sh

TASTY_FROMAT_FILE="tasty/src/dotty/tools/tasty/TastyFormat.scala"
MINOR_TASTY_VERSION_SUPPORTED_BY_TASTY_MIMA=3
MINOR_TASTY_VERSION=$(grep -oE 'val MinorVersion: Int = ([0-9]+)' $TASTY_FROMAT_FILE | grep -oE '[0-9]+')
EXPERIMENTAL_TASTY_VERSION=$(grep -oE 'val ExperimentalVersion: Int = ([0-9]+)' $TASTY_FROMAT_FILE | grep -oE '[0-9]+')

setTastyVersion() {
sed -i -E -e "s/val MinorVersion: Int = [0-9]+/val MinorVersion: Int = $1/" -e "s/val ExperimentalVersion: Int = [0-9]+/val ExperimentalVersion: Int = $2/" $TASTY_FROMAT_FILE
}

setTastyVersion $MINOR_TASTY_VERSION_SUPPORTED_BY_TASTY_MIMA 0

# Run stdlib-bootstrapped/tastyMiMaReportIssues using a custom TASTy version.
# We clean before to make sure all sources are recompiled using the new TASTY version.
# We clean after to make sure no other test will use the TASTy generated with this version.
"$SBT" "clean; stdlib-bootstrapped/clean; reload; stdlib-bootstrapped/tastyMiMaReportIssues; clean; stdlib-bootstrapped/clean"

setTastyVersion $MINOR_TASTY_VERSION $EXPERIMENTAL_TASTY_VERSION

0 comments on commit fea4f47

Please sign in to comment.