diff --git a/.circleci/config.yml b/.circleci/config.yml index 31f090e68b..91074c9361 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,15 +7,6 @@ executors: ubuntu: docker: - image: buildpack-deps:focal - mac: - environment: - EMSDK_NOTTY: "1" - # Without this, any `brew install` command will result in self-update of - # brew itself which takes more than 4 minutes. - HOMEBREW_NO_AUTO_UPDATE: "1" - macos: - xcode: "12.5.1" - resource_class: macos.x86.medium.gen2 mac_arm64: environment: EMSDK_NOTTY: "1" @@ -94,11 +85,6 @@ jobs: name: Install debian packages command: sudo apt-get update -q && sudo apt-get install -q cmake build-essential openjdk-8-jre-headless - run: test/test.sh - test-mac: - executor: mac - steps: - - setup-macos - - test-macos test-mac-arm64: executor: mac_arm64 steps: @@ -257,11 +243,10 @@ jobs: apt-get install -q -y bazel - run: test/test_bazel.sh - test-bazel-mac: - executor: mac + test-bazel-mac-arm64: + executor: mac_arm64 steps: - checkout - - run: brew install grep - run: name: install bazelisk command: | @@ -301,9 +286,6 @@ workflows: test-linux-arm64: jobs: - test-linux-arm64 - test-mac: - jobs: - - test-mac test-mac-arm64: jobs: - test-mac-arm64 @@ -328,9 +310,9 @@ workflows: test-bazel-linux: jobs: - test-bazel-linux - test-bazel-mac: + test-bazel-mac-arm64: jobs: - - test-bazel-mac + - test-bazel-mac-arm64 test-bazel-windows: jobs: - test-bazel-windows diff --git a/scripts/get_release_info.py b/scripts/get_release_info.py new file mode 100755 index 0000000000..01044cad94 --- /dev/null +++ b/scripts/get_release_info.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import json +import os +import sys + +def get_latest(tagfile): + with open(tagfile) as f: + versions = json.load(f) + print(versions['aliases']['latest']) + return 0 + + +def get_hash(tagfile, version): + with open(tagfile) as f: + versions = json.load(f) + print(versions['releases'][version]) + return 0 + + +if __name__ == '__main__': + if sys.argv[2] == 'latest': + sys.exit(get_latest(sys.argv[1])) + if sys.argv[2] == 'hash': + sys.exit(get_hash(sys.argv[1], sys.argv[3])) diff --git a/test/test_bazel.sh b/test/test_bazel.sh index d8d40e1716..51500acee0 100755 --- a/test/test_bazel.sh +++ b/test/test_bazel.sh @@ -6,13 +6,10 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER=$(grep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ - emscripten-releases-tags.json \ - | sed --expression "s/\./\\\./g") +VER=$(scripts/get_release_info.py emscripten-releases-tags.json latest) + # Based on the latest version number, get the commit hash for that version. -HASH=$(grep "\"${VER}\"" emscripten-releases-tags.json \ - | grep -v latest \ - | cut -f4 -d\") +HASH=$(scripts/get_release_info.py emscripten-releases-tags.json hash ${VER}) FAILMSG="!!! scripts/update_bazel_workspace.py needs to be run !!!" diff --git a/test/test_bazel_mac.sh b/test/test_bazel_mac.sh index 4b58b502bd..fa31103632 100755 --- a/test/test_bazel_mac.sh +++ b/test/test_bazel_mac.sh @@ -6,13 +6,10 @@ set -x set -e # Get the latest version number from emscripten-releases-tag.json. -VER=$(ggrep -oP '(?<=latest\": \")([\d\.]+)(?=\")' \ - emscripten-releases-tags.json \ - | sed "s/\./\\\./g") +VER=$(scripts/get_release_info.py emscripten-releases-tags.json latest) + # Based on the latest version number, get the commit hash for that version. -HASH=$(grep "\"${VER}\"" emscripten-releases-tags.json \ - | grep -v latest \ - | cut -f4 -d\") +HASH=$(scripts/get_release_info.py emscripten-releases-tags.json hash ${VER}) FAILMSG="!!! scripts/update_bazel_workspace.py needs to be run !!!"