Skip to content

update versions.json in CI (#5930) #24

update versions.json in CI (#5930)

update versions.json in CI (#5930) #24

name: GH Cherrypick bugfixes/features for LTS/Prod
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
on:
push:
branches:
- dev
jobs:
# Check if the PR is a bugfix/feature
check_labels:
runs-on: ubuntu-latest
permissions:
pull-requests: write
name: Check PR labels action step
# Make the output of this job available to other jobs
outputs:
result: ${{steps.execute_py_script.outputs.result}}
steps:
- name: Checkout files (only the PR Label Checker)
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/pr_label_checker.py
.github/requirements.txt
sparse-checkout-cone-mode: false
- name: List files in current Directory
run: ls .github
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python Packages
run: |
python -m pip install --upgrade pip
pip install -r ./.github/requirements.txt
- name: Write Output
id: execute_py_script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_URL: ${{ secrets.GITHUB_API_URL }}
GITHUB_SERVER_URL: ${{ secrets.GITHUB_SERVER_URL }}
GITHUB_SHA: ${{ secrets.GITHUB_SHA }}
run: echo "result=$(python ./.github/pr_label_checker.py)" >> "$GITHUB_OUTPUT"
- name: Show Output
run: echo "${{ steps.execute_py_script.outputs.result }}"
build-lts:
needs: check_labels
# Only run this step if code was a bugfix
if: contains(needs.check_labels.outputs.result, 'bugfix_')
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0} # bash login mode so conda can auto activate isis env
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive
ref: '8.0' # This branch must exist in the repo. Target LTS changes branch.
fetch-depth: '0'
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Cherry Pick
env:
GITHUB_SHA: ${{ secrets.GITHUB_SHA }}
run: git cherry-pick -m 1 $GITHUB_SHA
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: isis
environment-file: environment.yml
auto-activate-base: false
auto-update-conda: true
- name: Check Environment (Debug)
env:
ISISROOT: ${{ github.workspace }}/build
run: |
echo "--- Conda Env"
conda info --envs
echo "--- cmake Location (Should be in isis conda env)"
which cmake
cmake --version
echo "--- python location"
which python
echo "--- Working Directory"
pwd
echo "--- Files"
ls
echo "--- ISISROOT"
echo $ISISROOT
- name: Build ISIS
env:
ISISROOT: ${{ github.workspace }}/build
run: |
mkdir build
cd build
cmake -GNinja -DJP2KFLAG=OFF ../isis
ninja -j8
- name: Push to LTS branch
run: |
git push
build-prod:
needs: check_labels
# Only run this step if code was a bugfix
if: contains(needs.check_labels.outputs.result, 'production_update_')
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0} # bash login mode so conda can auto activate isis env
steps:
- name: TODO
run: |
echo "TODO: This Job is for future use, cherry-picking to a production branch."
echo "Once the name of the production branch is decided, "
echo "uncomment the rest of this job, and "
echo "update the "ref:" in the next step, "Checkout Repo."
# - name: Checkout Repo
# uses: actions/checkout@v4
# with:
# submodules: recursive
# ref: '8.0' # This branch must exist in the repo. Target PROD changes branch.
# fetch-depth: '0'
# - name: Configure git
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# - name: Cherry Pick
# env:
# GITHUB_SHA: ${{ secrets.GITHUB_SHA }}
# run: git cherry-pick -m 1 $GITHUB_SHA
# - name: Setup conda
# uses: conda-incubator/setup-miniconda@v3
# with:
# miniconda-version: "latest"
# activate-environment: isis
# environment-file: environment.yml
# auto-activate-base: false
# auto-update-conda: true
# - name: Check Environment (Debug)
# env:
# ISISROOT: ${{ github.workspace }}/build
# run: |
# echo "--- Conda Env"
# conda info --envs
# echo "--- cmake Location (Should be in isis conda env)"
# which cmake
# cmake --version
# echo "--- python location"
# which python
# echo "--- Working Directory"
# pwd
# echo "--- Files"
# ls
# echo "--- ISISROOT"
# echo $ISISROOT
# - name: Build ISIS
# env:
# ISISROOT: ${{ github.workspace }}/build
# run: |
# mkdir build
# cd build
# cmake -GNinja -DJP2KFLAG=OFF ../isis
# ninja -j8
# - name: Push to LTS branch
# run: |
# git push