Skip to content

Release 2024.11rc2 #359

Release 2024.11rc2

Release 2024.11rc2 #359

Workflow file for this run

name: Conda build release
on:
release:
types: [released, prereleased]
jobs:
sanity_check:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.sanity_check.outputs.packages }}
prerelease: ${{ steps.sanity_check.outputs.prerelease }}
overwrite_flag: ${{ steps.sanity_check.outputs.overwrite_flag }}
steps:
- name: Checkout skare3
uses: actions/checkout@v4
with:
path: skare3
- name: Fetch Skare3 Tools
uses: actions/checkout@v4
with:
repository: sot/skare3_tools
ref: master
path: skare3_tools
- id: sanity_check
run: |
sudo pip3 install --upgrade setuptools
sudo pip3 install -r ./skare3_tools/requirements.txt
sudo pip3 install ./skare3_tools
skare3-release-check --skare3-path ./skare3 --version $GITHUB_REF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_TOKEN: ${{ secrets.CHANDRA_XRAY_TOKEN }}
build-linux:
runs-on: ubuntu-latest
name: Build on Linux
needs: [sanity_check]
steps:
- name: Login to GitHub Package Registry
run: docker login docker.pkg.github.com -u $GITHUB_ACTOR -p ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker image
run: docker pull docker.pkg.github.com/sot/skare3/centos7-builder:latest
- name: Build
id: build
run: |
echo "Packages: ${{needs.sanity_check.outputs.packages}}"
echo "Override flag: ${{needs.sanity_check.outputs.overwrite_flag}}"
for package in ${{needs.sanity_check.outputs.packages}}; do
docker run --rm --name builder -v $GITHUB_WORKSPACE:/github/workspace -w /github/workspace \
-e CONDA_PASSWORD -e GIT_USERNAME -e GIT_PASSWORD \
docker.pkg.github.com/sot/skare3/centos7-builder:latest ${package} \
--tag ${GITHUB_SHA} --skare3-branch ${GITHUB_SHA} ${{needs.sanity_check.outputs.overwrite_flag}};
done;
touch builds/linux-64/.empty
touch builds/noarch/.empty
env:
CONDA_PASSWORD: ${{ secrets.CONDA_PASSWORD }}
GIT_USERNAME: chandra-xray
GIT_PASSWORD: ${{ secrets.CHANDRA_XRAY_TOKEN }}
GIT_ASKPASS: /home/aca/git_pass.py
- name: Save packages
uses: actions/upload-artifact@v4
with:
name: conda-package-ubuntu-latest
path: |
builds/linux-64/
builds/noarch/
!builds/*/*repodata*
!builds/*/index.html
build-other:
runs-on: ${{ matrix.os }}
name: Build on ${{ matrix.os }}
needs: [sanity_check]
strategy:
fail-fast: false
matrix:
os: ["macos-13", "macos-latest", "windows-2019"]
defaults:
run:
shell: bash -l {0}
steps:
- name: Fetch Skare3
uses: actions/checkout@v4
with:
path: skare3
- name: Fetch Skare3-tools
uses: actions/checkout@v4
with:
repository: sot/skare3_tools
ref: master
path: skare3_tools
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
python-version: "3.11"
activate-environment: conda-build
channels: conda-forge
- name: Add flight channel
run: conda config --env --add channels https://ska:${{ secrets.CONDA_PASSWORD }}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/flight
- name: Update Conda Environment
run: conda env update -n conda-build -f ./skare3/build-environment.yml
- name: Build Package
run: |
os="${{ matrix.os }}"
echo "Packages: ${{needs.sanity_check.outputs.packages}}"
echo "Override flag: ${{needs.sanity_check.outputs.overwrite_flag}}"
for package in ${{needs.sanity_check.outputs.packages}}; do
if [[ ("${os:0:7}" != "windows") || ("${package:0:9}" != "ska3-perl") ]]; then
python skare3_tools/skare3_tools/scripts/build.py ${package} \
--arch-specific --tag ${GITHUB_SHA} --skare3-branch ${GITHUB_SHA} ${{needs.sanity_check.outputs.overwrite_flag}};
fi;
done;
env:
CONDA_PASSWORD: ${{ secrets.CONDA_PASSWORD }}
GIT_USERNAME: chandra-xray
GIT_ASKPASS: ${{ github.workspace }}/skare3_tools/actions/build/files/git_pass.py
GIT_PASSWORD: ${{ secrets.CHANDRA_XRAY_TOKEN }}
- name: Review built packages
run: ls -l builds/*
- name: Save package
uses: actions/upload-artifact@v4
with:
name: conda-package-${{ matrix.os }}
path: |
builds/noarch/
builds/osx-64/
builds/osx-arm64/
builds/win-64/
!builds/*/*repodata*
!builds/*/index.html
update-channel:
runs-on: head
name: Update Conda Channel
needs: [build-linux, build-other]
steps:
- name: Get packages
uses: actions/[email protected]
with:
pattern: conda-package-*
path: package
- name: Show files
run: tree package
- name: Update channel
run: |
echo ${CONDA_CHANNEL_DIR}
rsync -av package/conda-package-*/* ${CONDA_CHANNEL_DIR}
conda index ${CONDA_CHANNEL_DIR}
env:
CONDA_CHANNEL_DIR: /proj/sot/ska/www/ASPECT/ska3-conda/test
regression-test:
runs-on: head
name: Regression Tests
needs: [sanity_check, update-channel]
strategy:
matrix:
package: [ska3-flight, ska3-matlab]
steps:
- name: Fetch ska_testr
uses: actions/checkout@v4
with:
repository: sot/ska_testr
ref: master
path: ska_testr
- name: Regression Tests
if: contains(needs.sanity_check.outputs.packages, matrix.package) && (matrix.package == 'ska3-flight' || !contains(needs.sanity_check.outputs.packages, 'ska3-flight'))
run: |
RELEASE_TAG=`basename "$GITHUB_REF"`
conda create -y -n ${{ matrix.package }}-${RELEASE_TAG} --override-channels \
-c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/test \
-c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/masters \
-c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/flight \
${{ matrix.package }}==${RELEASE_TAG}
source activate ${{ matrix.package }}-${RELEASE_TAG}
mamba install -y --override-channels \
-c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/test \
-c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/masters \
-c https://ska:${CONDA_PASSWORD}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/flight \
ska3-perl skare3_tools
ln -s /proj/sot/ska3/test/data $CONDA_PREFIX/data
export SKA=$CONDA_PREFIX
run_testr --root ./ska_testr --outputs-dir /export/kadi/ska_testr/release_tests
skare3-test-results --stream releases --tag head /export/kadi/ska_testr/release_tests/logs/last
# add test result report to PR description
env:
CONDA_PASSWORD: ${{ secrets.CONDA_PASSWORD }}
SKA: /proj/sot/ska
SYBASE_OCS: OCS-16_0
SYBASE: /soft/SYBASE16.0
LD_LIBRARY_PATH: /soft/SYBASE16.0/OCS-16_0/lib