Skip to content

Commit

Permalink
standardize CI configurations for additional platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
aliciaaevans committed Jul 5, 2024
1 parent 445e9d9 commit 45d8860
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 68 deletions.
34 changes: 20 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ jobs: # a basic unit of work in a run

- run:
name: Check for Additional Platforms
command: ./.circleci/check-for-additional-platforms.sh "origin/master...HEAD" "build_and_test"
command: |
result = $(../scripts/check-for-additional-platforms.sh "origin/master...HEAD" "build_and_test" "${CIRCLE_JOB}")
if [[ result != "build" ]]
then
echo "No recipes using this platform, skipping rest of job."
circleci-agent step halt
fi
- run:
name: Fetch bioconda install script
Expand Down Expand Up @@ -99,7 +105,13 @@ jobs: # a basic unit of work in a run

- run:
name: Check for Additional Platforms
command: ./.circleci/check-for-additional-platforms.sh "${CIRCLE_SHA1}~1 ${CIRCLE_SHA1}" "build_and_upload"
command: |
result = $(../scripts/check-for-additional-platforms.sh "${CIRCLE_SHA1}~1 ${CIRCLE_SHA1}" "build_and_upload" "${CIRCLE_JOB}")
if [[ result != "build" ]]
then
echo "No recipes using this platform, skipping rest of job."
circleci-agent step halt
fi
- run:
name: Fetch bioconda install script
Expand All @@ -124,11 +136,9 @@ jobs: # a basic unit of work in a run
- run:
name: Build and push
command: |
source /opt/mambaforge/etc/profile.d/conda.sh
source /opt/mambaforge/etc/profile.d/mamba.sh
mamba activate bioconda
# Use SDK with arm64 support
set -e
eval "$(conda shell.bash hook)"
conda activate bioconda
source common.sh
bioconda-utils handle-merged-pr recipes config.yml \
Expand Down Expand Up @@ -194,12 +204,8 @@ jobs: # a basic unit of work in a run
name: Build and upload
command: |
set -e
. common.sh
source /opt/mambaforge/etc/profile.d/conda.sh
source /opt/mambaforge/etc/profile.d/mamba.sh
mamba activate bioconda
# Use SDK with arm64 support
eval "$(conda shell.bash hook)"
conda activate bioconda
source common.sh
echo '============'
Expand Down Expand Up @@ -253,6 +259,6 @@ workflows:
matrix:
parameters:
os:
- osx-arm64
# - osx-arm64 Bulk is on GitHub Actions
- linux-aarch64
runner: [0, 1, 2, 3, 4, 5]
47 changes: 0 additions & 47 deletions .github/check-for-additional-platforms.sh

This file was deleted.

8 changes: 7 additions & 1 deletion .github/workflows/PR-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ jobs:
# bail if there's no osx-arm64 recipes
- name: Check for Additional Platforms
id: additional_platforms
run: ./.github/check-for-additional-platforms.sh "origin/master...HEAD" "build_and_test"
run: |
result = $(../scripts/check-for-additional-platforms.sh "origin/master...HEAD" "build_and_test" "${GITHUB_JOB}")
if [[ result != "build" ]]
then
echo "No recipes using this platform, skipping rest of job."
echo "skip_build=true" >> $GITHUB_OUTPUT
fi
- name: set path
run: echo "/opt/mambaforge/bin" >> $GITHUB_PATH
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/master-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ jobs:
# bail if there's no osx-arm64 recipes
- name: Check for Additional Platforms
id: additional_platforms
run: ./.github/check-for-additional-platforms.sh "${GITHUB_SHA}~1 ${GITHUB_SHA}" "build_and_upload"
run: |
result = $(../scripts/check-for-additional-platforms.sh "${GITHUB_SHA}~1 ${GITHUB_SHA}" "build_and_upload" "${GITHUB_JOB}")
if [[ result != "build" ]]
then
echo "No recipes using this platform, skipping rest of job."
echo "skip_build=true" >> $GITHUB_OUTPUT
fi
- name: set path
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# arguments
git_range=$1
job_name=$2
current_job=$3

# Download ARM version of yq
yq_platform=$(uname)
Expand All @@ -21,7 +22,6 @@ files=`git diff --name-only --diff-filter AMR ${git_range} | grep -E 'meta.yaml$
build=0

for file in $files; do
echo $file
# To create a properly-formatted yaml that yq can parse, comment out jinja2
# variable setting with {% %} and remove variable use with {{ }}.
additional_platforms=$(cat $file \
Expand All @@ -37,7 +37,7 @@ for file in $files; do

# Check if any additional platforms match this job
for additional_platform in $additional_platforms; do
if [ "${CIRCLE_JOB}" = "${job_name}-${additional_platform}" ]
if [ "${current_job}" = "${job_name}-${additional_platform}" ]
then
build=1
break
Expand All @@ -46,8 +46,7 @@ for file in $files; do
done

# If no changed recipes apply to this platform, skip remaining steps
if [[ build -lt 1 ]]
if [[ build -gt 0 ]]
then
echo "No recipes using this platform, skipping rest of job."
circleci-agent step halt
echo "build"
fi

0 comments on commit 45d8860

Please sign in to comment.