Skip to content

Commit

Permalink
build-conda integration for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Brockett authored and Jonathan Brockett committed Oct 23, 2023
1 parent a0174c0 commit c5f714d
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 1 deletion.
62 changes: 61 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
commit: ${{ steps.vars.output.tag_sha }}
tag: ${{ github.event.inputs.tag }}

build-osx:
build-os12:
runs-on: macos-12
timeout-minutes: 30
env:
Expand Down Expand Up @@ -98,6 +98,66 @@ jobs:
commit: ${{ steps.vars.output.tag_sha }}
tag: ${{ github.event.inputs.tag }}

build-os13:
runs-on: macos-13
timeout-minutes: 30
env:
CCTOOLS_OUTPUT: ${{ format('cctools-{0}-x86_64-{1}.tar.gz', github.event.inputs.version, 'osx-13') }}
needs: lint
steps:
- name: checkout CCTools from branch head
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
- name: checkout CCTools from tag
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
- name: Get sha of tag
id: vars
shell: bash
run: echo "{tag_sha}=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Conda-Setup
run: |
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
~/miniconda3/bin/conda init zsh
source ~/.zshrc
conda install -n base conda-libmamba-solver
conda create --name cctools-build --yes --quiet --channel conda-forge --strict-channel-priority --solver=libmamba python=3 gdb m4 perl swig make zlib libopenssl-static openssl conda-pack cloudpickle packaging
shell: zsh
- name: Verify Conda Installation
run: conda list --name cctools-build
shell: zsh
- name: Configure
run: ${GITHUB_WORKSPACE}/packaging/build-conda/configure.sh
shell: zsh
- name: Build
run: ${GITHUB_WORKSPACE}/packaging/build-conda/build.sh
shell: zsh
- name: Install
run: ${GITHUB_WORKSPACE}/packaging/build-conda/install.sh
shell: zsh
- name: Test
run: ${GITHUB_WORKSPACE}/packaging/build-conda/test.sh
shell: zsh
- name: deploy
uses: ncipollo/release-action@v1
if: github.event_name == 'workflow_dispatch'
with:
artifacts: /tmp/${{ env.CCTOOLS_OUTPUT }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
artifactContentType: application/gzip
draft: true
omitBody: true
omitBodyDuringUpdate: true
prerelease: true
replacesArtifacts: true
commit: ${{ steps.vars.output.tag_sha }}
tag: ${{ github.event.inputs.tag }}

build-conda:
needs: lint
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions packaging/mac-os/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

conda run --name cctools-build make
11 changes: 11 additions & 0 deletions packaging/mac-os/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Leave out some items that are research prototypes.
DISABLED_SYS=$(echo --without-system-{parrot,prune,umbrella,weaver})
DISABLED_LIB=$(echo --with-{readline,fuse,perl}-path\ no)

# Now configure in the normal way.
conda run --name cctools-build ./configure --strict ${DISABLED_SYS} ${DISABLED_LIB} "$@"
[[ -f config.mk ]] && make clean
echo === Contents of config.mk ===
cat config.mk
3 changes: 3 additions & 0 deletions packaging/mac-os/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/bash

conda run --name cctools-build make install
7 changes: 7 additions & 0 deletions packaging/mac-os/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
~/miniconda3/bin/conda init zsh

conda create --name cctools-build --yes --quiet --channel conda-forge --strict-channel-priority --experimental-solver=libmamba python=3 gdb m4 perl swig make zlib libopenssl-static openssl conda-pack cloudpickle packaging
11 changes: 11 additions & 0 deletions packaging/mac-os/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if ! conda run --name cctools-build make test
then
echo === Contents of cctools.test.fail ===
cat cctools.test.fail
exit 1
else
exit 0
fi

0 comments on commit c5f714d

Please sign in to comment.