Skip to content

Commit 53eaff1

Browse files
authored
Merge branch 'dev' into web_spice_calls
2 parents 96e4a1b + 0f27e34 commit 53eaff1

File tree

375 files changed

+113247
-3790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

375 files changed

+113247
-3790
lines changed

.github/pr_label_checker.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"X-GitHub-Api-Version": "2022-11-28"
2525
}
2626

27+
BUGFIX_CHANGE_TYPE = False
28+
2729
def get_prs_associated_with_commit() -> Response:
2830
"""
2931
Get list of PRs associated with commit.
@@ -67,7 +69,7 @@ def search_for_linked_issues(pull_body: str) -> list:
6769
issue_numbers = []
6870
for section in pull_body_list:
6971
# Find section with heading 'Related Issue'
70-
if section != None and 'Related Issue' in section:
72+
if section and 'Related Issue' in section:
7173
# Find items that match the regex pattern
7274
matched_items = rgx.findall(regex_pattern, section)
7375
# Convert list of tuples to list of all items
@@ -76,6 +78,13 @@ def search_for_linked_issues(pull_body: str) -> list:
7678
filtered_list = list(filter(None, flattened_list))
7779
# Remove '#' from items
7880
issue_numbers = list(map(lambda item: item.replace('#', ''), filtered_list))
81+
# Check if change type is bugfix
82+
# Find section with heading 'Types of changes'
83+
if section and 'Types of changes' in section:
84+
matched_items = rgx.findall(r'\[(x|X)\] Bug fix', section)
85+
if matched_items:
86+
global BUGFIX_CHANGE_TYPE
87+
BUGFIX_CHANGE_TYPE = True
7988
return issue_numbers
8089

8190

@@ -143,8 +152,11 @@ def get_pr(pull_number: str) -> Response:
143152

144153
def is_pr_bugfix(response: Response) -> bool:
145154
"""
146-
Check PR label for 'bug'
155+
Check PR label for 'bug' or if change type is indicated as bugfix
156+
in the body of the PR
147157
"""
158+
if BUGFIX_CHANGE_TYPE:
159+
return True
148160
labels = response.json().get("labels")
149161
for label in labels:
150162
if label.get("name") == "bug":
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Github Actions - Build Dev Biweekly Anaconda Release
2+
3+
env:
4+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
5+
ENCRYPTION_KEY: ${{ secrets.KDU_ENC_KEY }}
6+
7+
on:
8+
schedule:
9+
- cron: '0 5 * * 6' # 10:00 PM MST Friday (UTC: Saturday 5:00 AM)
10+
workflow_dispatch: # Option to manually run pipeline in Actions
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-13, macos-14]
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Skip odd weeks
22+
run: |
23+
WEEK_NUM=$(date +%V)
24+
if (( WEEK_NUM % 2 != 0 )); then
25+
echo "Skipping this week ($WEEK_NUM is odd)."
26+
exit 0
27+
fi
28+
29+
- uses: actions/checkout@v4
30+
31+
- name: Set up Mambaforge
32+
uses: conda-incubator/setup-miniconda@v3
33+
with:
34+
miniforge-variant: Miniforge3
35+
auto-update-conda: true
36+
use-mamba: true
37+
38+
- name: Build Release
39+
run: |
40+
export ISIS_VERSION=$(date +%Y.%m.%d)
41+
echo $ISIS_VERSION
42+
43+
mamba install conda-build anaconda-client
44+
git fetch origin
45+
git checkout dev
46+
cd recipe
47+
48+
echo $ENCRYPTION_KEY | openssl enc -aes-256-cbc -d -in kakadu/kakadu_7_9.zip.enc -out kakadu/kakadu_7_9.zip -pbkdf2 -iter 10000 -pass stdin
49+
unzip -j kakadu/kakadu_7_9.zip -d /tmp/kakadu_7_9 -x "__MACOSX/*"
50+
51+
52+
if [[ "$OSTYPE" == "darwin"* ]]; then
53+
sed -i '' "s|/isisData/kakadu|/tmp/kakadu_7_9|g" build.sh
54+
sed -i '' "s/{% set version = \"[^\"]*\" %}/{% set version = \"$ISIS_VERSION\" %}/" meta.yaml
55+
sed -i '' "s/version: {{ version }}.0_RC[^ ]*/version: {{ version }}/" meta.yaml
56+
sed -i '' "s/git_tag: {{ version }}/git_tag: 'dev'/" meta.yaml
57+
else
58+
sed -i "s|/isisData/kakadu|/tmp/kakadu_7_9|g" build.sh
59+
sed -i "s/{% set version = \"[^\"]*\" %}/{% set version = \"$ISIS_VERSION\" %}/" meta.yaml
60+
sed -i "s/version: {{ version }}.0_RC[^ ]*/version: {{ version }}/" meta.yaml
61+
sed -i "s/git_tag: {{ version }}/git_tag: 'dev'/" meta.yaml
62+
fi
63+
64+
conda build . -c usgs-astrogeology -c conda-forge --override-channels --user usgs-astrogeology --label dev
65+
66+
test:
67+
runs-on: ${{ matrix.os }}
68+
needs: build
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
os: [ubuntu-latest, macos-13, macos-14]
73+
74+
steps:
75+
- name: Set up Miniforge
76+
uses: conda-incubator/setup-miniconda@v3
77+
with:
78+
miniforge-variant: Miniforge3
79+
auto-update-conda: true
80+
activate-environment: isis-test
81+
use-mamba: true
82+
mamba-version: "1.5.3"
83+
84+
- name: Conda install and test spiceinit
85+
run: |
86+
export ISIS_VERSION=$(date +%Y.%m.%d)
87+
88+
source "${CONDA}/etc/profile.d/conda.sh"
89+
conda activate isis-test
90+
91+
conda install -c conda-forge -c usgs-astrogeology usgs-astrogeology/label/dev::isis=${ISIS_VERSION} -y
92+
93+
export ISISROOT=$CONDA_PREFIX
94+
conda list isis
95+
spiceinit -h
96+
97+
docs:
98+
name: Build and Upload ISIS Dev Docs
99+
runs-on: ubuntu-latest
100+
needs: test
101+
if: ${{ success() }}
102+
steps:
103+
- uses: actions/checkout@v4
104+
with:
105+
submodules: recursive
106+
107+
- name: Set up Conda for doc build
108+
uses: conda-incubator/setup-miniconda@v3
109+
with:
110+
miniforge-variant: Miniforge3
111+
auto-update-conda: true
112+
environment-file: environment.yml
113+
activate-environment: isis
114+
use-mamba: true
115+
116+
- name: Build documentation
117+
run: |
118+
source "${CONDA}/etc/profile.d/conda.sh"
119+
conda activate isis
120+
mkdir build && cd build
121+
export ISISROOT=$(pwd)
122+
cmake -GNinja ../isis
123+
ninja docs
124+
125+
- name: Set AWS credentials for upload
126+
uses: aws-actions/configure-aws-credentials@v4
127+
with:
128+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
129+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
130+
aws-region: us-west-2
131+
132+
- name: Upload to S3
133+
run: |
134+
cd /home/runner/work/ISIS3/ISIS3/build/docs && cd "$(find . -maxdepth 1 -type d ! -name .)"
135+
echo "Uploading documentation to S3..."
136+
aws s3 sync ./ s3://asc-public-docs/isis-site/dev/ --delete

.github/workflows/github-release.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Github Actions - Build Anaconda Release
2+
3+
env:
4+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
5+
ENCRYPTION_KEY: ${{ secrets.KDU_ENC_KEY }}
6+
7+
on:
8+
release:
9+
types: [prereleased, released]
10+
push:
11+
branches:
12+
- '*.*.*_RC*'
13+
- '*.*.*_LTS'
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-13, macos-14]
20+
runs-on: ${{ matrix.os }}
21+
22+
outputs:
23+
isis_version: ${{ steps.set_version.outputs.isis_version }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set ISIS_VERSION
29+
id: set_version
30+
run: echo "isis_version=${{ github.event.release.tag_name || github.ref_name }}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Set up Mambaforge
33+
uses: conda-incubator/setup-miniconda@v3
34+
with:
35+
miniforge-variant: Miniforge3
36+
auto-update-conda: true
37+
use-mamba: true
38+
39+
- name: Build Release
40+
env:
41+
ISIS_VERSION: ${{ steps.set_version.outputs.isis_version }}
42+
run: |
43+
mamba install conda-build anaconda-client
44+
git fetch origin
45+
if [[ "$ISIS_VERSION" =~ .*_RC[0-9]$ ]]; then
46+
git checkout $ISIS_VERSION
47+
else
48+
git checkout refs/tags/$ISIS_VERSION
49+
fi
50+
cd recipe
51+
echo $ENCRYPTION_KEY | openssl enc -aes-256-cbc -d -in kakadu/kakadu_7_9.zip.enc -out kakadu/kakadu_7_9.zip -pbkdf2 -iter 10000 -pass stdin
52+
unzip -j kakadu/kakadu_7_9.zip -d /tmp/kakadu_7_9 -x "__MACOSX/*"
53+
if [[ "$OSTYPE" == "darwin"* ]]; then
54+
sed -i '' "s|/isisData/kakadu|/tmp/kakadu_7_9|g" build.sh
55+
else
56+
sed -i "s|/isisData/kakadu|/tmp/kakadu_7_9|g" build.sh
57+
fi
58+
59+
if [[ "$ISIS_VERSION" =~ .*_RC[0-9]$ ]]; then
60+
conda build . -c usgs-astrogeology -c conda-forge --override-channels --user usgs-astrogeology --label RC
61+
elif [[ "$ISIS_VERSION" =~ .*_LTS$ ]]; then
62+
conda build . -c usgs-astrogeology -c conda-forge --override-channels --user usgs-astrogeology --label LTS
63+
else
64+
conda build . -c usgs-astrogeology -c conda-forge --override-channels --user usgs-astrogeology --label LTS --label main
65+
fi
66+
67+
68+
test:
69+
runs-on: ${{ matrix.os }}
70+
needs: build
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
os: [ubuntu-latest, macos-13, macos-14]
75+
env:
76+
ISIS_VERSION: ${{ needs.build.outputs.isis_version }}
77+
78+
steps:
79+
- name: Set up Miniforge
80+
uses: conda-incubator/setup-miniconda@v3
81+
with:
82+
miniforge-variant: Miniforge3
83+
auto-update-conda: true
84+
activate-environment: isis-test
85+
use-mamba: true
86+
mamba-version: "1.5.3"
87+
88+
- name: Conda install and test spiceinit
89+
run: |
90+
source "${CONDA}/etc/profile.d/conda.sh"
91+
conda activate isis-test
92+
if [[ "$ISIS_VERSION" =~ .*_RC[0-9]$ ]]; then
93+
conda install -c conda-forge -c usgs-astrogeology usgs-astrogeology/label/RC::isis=${ISIS_VERSION} -y
94+
elif [[ "$ISIS_VERSION" =~ .*_LTS$ ]]; then
95+
conda install -c conda-forge -c usgs-astrogeology usgs-astrogeology/label/LTS::isis=${ISIS_VERSION} -y
96+
else
97+
conda install -c conda-forge -c usgs-astrogeology isis=${ISIS_VERSION} -y
98+
fi
99+
100+
export ISISROOT=$CONDA_PREFIX
101+
conda list isis
102+
spiceinit -h
103+
104+
docs:
105+
name: Build and Upload ISIS Public Release Docs
106+
runs-on: ubuntu-latest
107+
needs: test
108+
env:
109+
ISIS_VERSION: ${{ needs.build.outputs.isis_version }}
110+
if: |
111+
success() &&
112+
!contains(needs.build.outputs.isis_version, '_RC') &&
113+
!contains(needs.build.outputs.isis_version, '_LTS')
114+
steps:
115+
- uses: actions/checkout@v4
116+
with:
117+
submodules: recursive
118+
119+
- name: Set up Conda for doc build
120+
uses: conda-incubator/setup-miniconda@v3
121+
with:
122+
miniforge-variant: Miniforge3
123+
auto-update-conda: true
124+
environment-file: environment.yml
125+
activate-environment: isis
126+
use-mamba: true
127+
128+
- name: Build documentation
129+
run: |
130+
source "${CONDA}/etc/profile.d/conda.sh"
131+
conda activate isis
132+
mkdir build && cd build
133+
export ISISROOT=$(pwd)
134+
cmake -GNinja ../isis
135+
ninja docs
136+
137+
- name: Set AWS credentials for upload
138+
uses: aws-actions/configure-aws-credentials@v4
139+
with:
140+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
141+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
142+
aws-region: us-west-2
143+
144+
- name: Upload to S3
145+
run: |
146+
cd /home/runner/work/ISIS3/ISIS3/build/docs
147+
if [ -d "${ISIS_VERSION}" ]; then
148+
cd "${ISIS_VERSION}"
149+
echo "Uploading documentation to S3..."
150+
aws s3 sync ./ s3://asc-public-docs/isis-site/${ISIS_VERSION}/ --delete
151+
else
152+
echo "Error: docs/${ISIS_VERSION} directory not found!"
153+
exit 1
154+
fi

.github/workflows/gitlab-lts.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,23 @@ jobs:
5151
- uses: actions/checkout@v4
5252
- name: Run script
5353
env:
54-
LTS_VERSION: 9.0.0_LTS # formatted as x.x.x_LTS
55-
BASE_LTS: 9.0
54+
LTS_VERSION: '9.0.0_LTS' # formatted as x.x.x_LTS
55+
BASE_LTS: '9.0'
5656
GITHUB_SHA: ${{ secrets.GITHUB_SHA }}
5757
run: |
5858
git config --global user.name "Github_CI"
5959
git config --global user.email "project_14468_bot_3f7d8e1a392afd88ead5f3f3154e809d@noreply.gitlab.com"
6060
git clone https://isis-codebuild-ci:[email protected]/astrogeology/isis-codebuild-ci.git
6161
echo $LTS_VERSION
6262
cd isis-codebuild-ci
63-
if [[ "git ls-remote --exit-code origin $LTS_VERSION" == 2 ]]; then
63+
if [[ $(git ls-remote --heads origin $LTS_VERSION | wc -l) -eq 0 ]]; then
64+
echo "Branch $LTS_VERSION does not exist, will create"
6465
git checkout -b $LTS_VERSION
6566
else
67+
echo "Branch $LTS_VERSION already exists"
6668
git checkout $LTS_VERSION
6769
git reset --hard origin/main
6870
fi
6971
echo -e "\nenv: \n shell: bash \n variables: \n LTS_VERSION: $LTS_VERSION \n BASE_LTS: $BASE_LTS \n ANACONDA_API_TOKEN: $ANACONDA_TOKEN \n GITHUB_SHA: $GITHUB_SHA" >> buildspec-lts.yml
7072
git commit -a -m "$LTS_VERSION"
71-
git push origin $LTS_VERSION --force
73+
git push origin $LTS_VERSION --force

0 commit comments

Comments
 (0)