Skip to content

Commit

Permalink
Simplify the check, don't pipe using tee, run sbt show verison twice
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Oct 19, 2024
1 parent 1e2ffd3 commit 1235578
Showing 1 changed file with 1 addition and 51 deletions.
52 changes: 1 addition & 51 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ jobs:
run : |
sbt --batch --no-colors "show scala3-compiler-bootstrapped/version"
version=$(sbt --batch --no-colors "show scala3-compiler-bootstrapped/version" \
| tee /dev/stdout \
| grep -Eo "3\.[0-9]+\.[0-9]+(-RC[0-9]+)?")
if [ "${version}" = "${{ env.RELEASE_TAG }}" ]; then
echo "Compiler version '${version}' matches tag: ${{ env.RELEASE_TAG }}"
Expand Down Expand Up @@ -133,58 +132,9 @@ jobs:
- name: Check compiler version
shell: bash
run : |
sbt --batch --no-colors "show scala3-compiler-bootstrapped/version"
if ! sbt --batch --no-colors "show scala3-compiler-bootstrapped/version" \
| tee /dev/stdout \
| grep -Eo "3\.[0-9]+\.[0-9]+-RC[0-9]+-bin-[0-9]{8}-[a-zA-Z0-9]{7}-NIGHTLY" >/dev/null 2>&1; then
echo "Version used by compiler to publish nightly release does not match expected pattern"
exit 1
fi
test-snapshot:
runs-on: [ubuntu-22.04]
container:
image: lampepfl/dotty:2024-10-18
options: --cpu-shares 4096
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache

steps:
######################################################################################
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
######################################################################################
- name: Set JDK 8 as default
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
- name: Reset existing repo
run: |
git config --global --add safe.directory /__w/scala3/scala3
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
- name: Checkout cleanup script
uses: actions/checkout@v4

- name: Cleanup
run: .github/workflows/cleanup.sh

- name: Git Checkout
uses: actions/checkout@v4

- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
# Extract the release tag
- name: Extract the release tag
run : echo "RELEASE_TAG=3.6.2" >> $GITHUB_ENV
# BUILD THE SDKs
- name: Check compiler version
shell: bash
run : |
sbt --batch --no-colors "show scala3-compiler-bootstrapped/version"
# TODO: Fix me, Commented out to test for debug purpuse, failed during release with no info
# Pipe through xargs to remove whitespaces
version=$(sbt --batch --no-colors "show scala3-compiler-bootstrapped/version" | grep -oEh "3\.\d+\.\d+([-a-zA-Z1-9]+)?")
if [ "${version}" = "${{ env.RELEASE_TAG }}" ]; then
echo "Compiler version '${version}' matches tag: ${{ env.RELEASE_TAG }}"
else
echo "Invalid compiler version '${version}', does not match tag: ${{ env.RELEASE_TAG }}"
exit 1
fi

0 comments on commit 1235578

Please sign in to comment.