Skip to content

Add macos-latest as optional CI test image #584

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

Merged
merged 9 commits into from
May 30, 2024
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,21 @@ jobs:
python ./deviceadvisor/script/DATestRun.py

osx:
runs-on: macos-13
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- macos-13
- macos-latest
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: Install boto3
# Starting from macos14, boto3 not longer available in homebrew python no longer https://github.com/Homebrew/homebrew-core/issues/157500
# use virtual env to work around it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation and duplicated "no longer"

run: |
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install boto3
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -99,26 +108,26 @@ jobs:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }}
run: |
source .venv/bin/activate
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}
- name: Running samples in CI setup
run: |
python3 -m pip install boto3
- name: configure AWS credentials (PubSub)
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.CI_PUBSUB_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run PubSub sample
run: |
source .venv/bin/activate
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pubsub_cfg.json
- name: run PKCS12 sample
run: |
cert=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/cert" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem
key=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem
pkcs12_password=$(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/PubSub/key_pkcs12_password" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\")
openssl pkcs12 -export -in /tmp/certificate.pem -inkey /tmp/privatekey.pem -out ./pkcs12-key.p12 -name PubSub_Thing_Alias -password pass:$pkcs12_password
source .venv/bin/activate
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_pkcs12_connect_cfg.json
- name: configure AWS credentials (MQTT5 samples)
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -127,6 +136,7 @@ jobs:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run MQTT5 PubSub sample
run: |
source .venv/bin/activate
python3 ${{ env.CI_UTILS_FOLDER }}/run_sample_ci.py --file ${{ env.CI_SAMPLES_CFG_FOLDER }}/ci_run_mqtt5_pubsub_cfg.json
- name: configure AWS credentials (Device Advisor)
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -135,6 +145,7 @@ jobs:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: run DeviceAdvisor
run: |
source .venv/bin/activate
cd ./aws-iot-device-sdk-python-v2
python3 ./deviceadvisor/script/DATestRun.py

Expand Down
Loading