Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove zap checkout for darwin builds in CI, assume CIPD provides this #24677

Merged
merged 7 commits into from
Jan 28, 2023
16 changes: 0 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,6 @@ jobs:
timeout-minutes: 200
runs-on: macos-latest
if: github.actor != 'restyled-io[bot]'

env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly

steps:
- uses: Wandalen/[email protected]
Expand Down Expand Up @@ -388,16 +382,6 @@ jobs:
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ jobs:
env:
BUILD_VARIANT: ${{matrix.build_variant}}
LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly

if: github.actor != 'restyled-io[bot]'
runs-on: macos-latest
Expand Down Expand Up @@ -76,16 +72,6 @@ jobs:
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,6 @@ jobs:
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
# This is scoped to only the steps that don't use xcodebuild.
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -122,32 +106,14 @@ jobs:
timeout-minutes: 15
run: |
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug chip_config_network_layer_ble=false
env:
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
# This is scoped to only the steps that don't use xcodebuild.
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly
- name: Build example OTA Provider
timeout-minutes: 10
run: |
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false
env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
# This is scoped to only the steps that don't use xcodebuild.
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly
- name: Build example OTA Requestor
timeout-minutes: 10
run: |
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false
env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
# This is scoped to only the steps that don't use xcodebuild.
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly
- name: Delete Defaults
run: defaults delete com.apple.dt.xctest.tool
continue-on-error: true
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/fuzzing-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ jobs:
runs-on: macos-latest
if: github.actor != 'restyled-io[bot]'

env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly

steps:
- uses: Wandalen/[email protected]
name: Checkout
Expand All @@ -117,16 +111,6 @@ jobs:
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ jobs:
CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
TSAN_OPTIONS: "halt_on_error=1"
LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly

if: github.actor != 'restyled-io[bot]'
runs-on: macos-latest
Expand Down Expand Up @@ -297,15 +293,6 @@ jobs:
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -545,10 +532,6 @@ jobs:
env:
BUILD_VARIANT: ${{matrix.build_variant}}
TSAN_OPTIONS: "halt_on_error=1"
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.19-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.19-nightly

if: github.actor != 'restyled-io[bot]' && false
runs-on: macos-latest
Expand Down Expand Up @@ -576,15 +559,6 @@ jobs:
ls -la /usr/local/Cellar/[email protected]
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
32 changes: 18 additions & 14 deletions scripts/tools/zap/version_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
# Set as a separate list to not pay the price of a full grep as the list of
# files is not likely to change often
USAGE_FILES_DEPENDING_ON_ZAP_VERSION = [
'.github/workflows/build.yaml',
'.github/workflows/darwin-tests.yaml',
'.github/workflows/darwin.yaml',
'.github/workflows/fuzzing-build.yaml',
'.github/workflows/tests.yaml',
'integrations/docker/images/chip-cert-bins/Dockerfile',
'scripts/zap.json',
]
Expand Down Expand Up @@ -96,9 +91,11 @@ class UpdateChoice(Flag):
#
# That line is of the form "MIN_ZAP_VERSION = '2021.1.9'"
ZAP_EXECUTION_SCRIPT = 'scripts/tools/zap/zap_execution.py'
ZAP_EXECUTION_MIN_RE = re.compile(r'(MIN_ZAP_VERSION = .)(\d\d\d\d\.\d\d?\.\d\d?)(.)')
ZAP_EXECUTION_MIN_RE = re.compile(
r'(MIN_ZAP_VERSION = .)(\d\d\d\d\.\d\d?\.\d\d?)(.)')

CHIP_ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
CHIP_ROOT_DIR = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..'))


@click.command()
Expand All @@ -117,14 +114,16 @@ class UpdateChoice(Flag):
default=None,
help='What version of ZAP to update to (like "v2023.01.09-nightly". If not set, versions will just be printed.')
def version_update(log_level, update, new_version):
coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt='%(asctime)s %(levelname)-7s %(message)s')
coloredlogs.install(level=__LOG_LEVELS__[
log_level], fmt='%(asctime)s %(levelname)-7s %(message)s')

update = __UPDATE_CHOICES__[update]

if new_version:
parsed = ZAP_VERSION_RE.match(new_version)
if not parsed:
logging.error(f"Version '{new_version}' does not seem to parse as a ZAP VERSION")
logging.error(
f"Version '{new_version}' does not seem to parse as a ZAP VERSION")
sys.exit(1)

# get the numeric version for zap_execution
Expand Down Expand Up @@ -161,15 +160,18 @@ def version_update(log_level, update, new_version):
while m:
version = file_data[m.start():m.end()]
if version == new_version:
logging.warning("Nothing to replace. Version already %s", version)
logging.warning(
"Nothing to replace. Version already %s", version)
break
file_data = file_data[:m.start()] + new_version + file_data[m.end():]
file_data = file_data[:m.start()] + \
new_version + file_data[m.end():]
need_replace = True
search_pos = m.end() # generally ok since our versions are fixed length
m = ZAP_VERSION_RE.search(file_data, search_pos)

if need_replace:
logging.info('Replacing with version %s in %s', new_version, name)
logging.info('Replacing with version %s in %s',
new_version, name)

with open(os.path.join(CHIP_ROOT_DIR, name), 'wt') as f:
f.write(file_data)
Expand All @@ -183,8 +185,10 @@ def version_update(log_level, update, new_version):
logging.info("Min version %s in %s", m.group(2), ZAP_EXECUTION_SCRIPT)
if new_version:
new_min_version = ("%d.%d.%d" % zap_min_version)
file_data = file_data[:m.start()] + m.group(1) + new_min_version + m.group(3) + file_data[m.end():]
logging.info('Updating min version to %s in %s', new_min_version, ZAP_EXECUTION_SCRIPT)
file_data = file_data[:m.start()] + m.group(1) + \
new_min_version + m.group(3) + file_data[m.end():]
logging.info('Updating min version to %s in %s',
new_min_version, ZAP_EXECUTION_SCRIPT)

with open(os.path.join(CHIP_ROOT_DIR, ZAP_EXECUTION_SCRIPT), 'wt') as f:
f.write(file_data)
Expand Down