Skip to content

Commit

Permalink
Merge pull request #58 from isuruf/github
Browse files Browse the repository at this point in the history
Move to github actions
  • Loading branch information
isuruf authored Nov 10, 2020
2 parents 7eaff09 + dd8c8f9 commit 379c08b
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 97 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build miniforge
on: [push, pull_request]

jobs:
build:
name: ${{ matrix.MINIFORGE_NAME }}-${{ matrix.OS_NAME }}-${{ matrix.ARCH }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
ARCH: arm64
MINIFORGE_NAME: "Miniforge3"
OS_NAME: "MacOSX"

- os: macos-latest
ARCH: x86_64
MINIFORGE_NAME: "Miniforge-pypy3"
OS_NAME: "MacOSX"

- os: macos-latest
ARCH: x86_64
MINIFORGE_NAME: "Miniforge3"
OS_NAME: "MacOSX"

- os: ubuntu-latest
ARCH: aarch64
DOCKER_ARCH: arm64v8
DOCKERIMAGE: condaforge/linux-anvil-aarch64
MINIFORGE_NAME: "Miniforge3"
OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: x86_64
DOCKER_ARCH: amd64
DOCKERIMAGE: condaforge/linux-anvil-comp7
MINIFORGE_NAME: "Miniforge3"
OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: ppc64le
DOCKER_ARCH: ppc64le
DOCKERIMAGE: condaforge/linux-anvil-ppc64le
MINIFORGE_NAME: "Miniforge3"
OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: aarch64
DOCKER_ARCH: arm64v8
DOCKERIMAGE: condaforge/linux-anvil-aarch64
MINIFORGE_NAME: "Miniforge-pypy3"
OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: x86_64
DOCKER_ARCH: amd64
DOCKERIMAGE: condaforge/linux-anvil-comp7
MINIFORGE_NAME: "Miniforge-pypy3"
OS_NAME: "Linux"

- os: ubuntu-latest
ARCH: ppc64le
DOCKER_ARCH: ppc64le
DOCKERIMAGE: condaforge/linux-anvil-ppc64le
MINIFORGE_NAME: "Miniforge-pypy3"
OS_NAME: "Linux"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build and test miniforge
env:
ARCH: ${{ matrix.ARCH }}
MINIFORGE_NAME: ${{ matrix.MINIFORGE_NAME }}
OS_NAME: ${{ matrix.OS_NAME }}
DOCKERIMAGE: ${{ matrix.DOCKERIMAGE }}
DOCKER_ARCH: ${{ matrix.DOCKER_ARCH }}
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
export MINIFORGE_VERSION=$${GITHUB_REF##*/};
fi
if [[ "$OS_NAME" == "Linux" ]]; then
bash build_miniforge.sh;
fi
if [[ "$OS_NAME" == "MacOSX" ]]; then
bash build_miniforge_osx.sh;
fi
# Copy for latest release
cp build/$MINIFORGE_NAME-*-$OS_NAME-$ARCH.sh build/$MINIFORGE_NAME-$OS_NAME-$ARCH.sh
ls -alh build
- name: Upload miniforge to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/Miniforge*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
if: startsWith(github.ref, 'refs/tags/')
91 changes: 0 additions & 91 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions build_miniforge.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -ex

# Check parameters
ARCH=${ARCH:-aarch64}
Expand All @@ -15,7 +15,7 @@ echo "============= Enable QEMU ============="
docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes

echo "============= Build the installer ============="
docker run --rm -ti -v $(pwd):/construct -e MINIFORGE_VERSION -e MINIFORGE_NAME $DOCKERIMAGE /construct/scripts/build.sh
docker run --rm -v $(pwd):/construct -e MINIFORGE_VERSION -e MINIFORGE_NAME $DOCKERIMAGE /construct/scripts/build.sh

echo "============= Download QEMU static binaries ============="
bash scripts/get_qemu.sh
Expand All @@ -24,6 +24,6 @@ echo "============= Test the installer ============="
for TEST_IMAGE_NAME in "ubuntu:20.04" "ubuntu:19.10" "ubuntu:16.04" "ubuntu:18.04" "centos:7" "debian:buster"
do
echo "============= Test installer on $TEST_IMAGE_NAME ============="
docker run --rm -ti -v $(pwd):/construct -v $(pwd)/build/qemu/qemu-${ARCH}-static:/usr/bin/qemu-${ARCH}-static ${DOCKER_ARCH}/$TEST_IMAGE_NAME /construct/scripts/test.sh
docker run --rm -v $(pwd):/construct -v $(pwd)/build/qemu/qemu-${ARCH}-static:/usr/bin/qemu-${ARCH}-static ${DOCKER_ARCH}/$TEST_IMAGE_NAME /construct/scripts/test.sh
done

4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -xe

echo "***** Start: Building Miniforge installer *****"

Expand All @@ -11,7 +11,7 @@ cd $CONSTRUCT_ROOT
# Constructor should be latest for non-native building
# See https://github.com/conda/constructor
echo "***** Install constructor *****"
conda install -y "constructor>=3.1.0" jinja2
conda install -y "constructor>=3.1.0" jinja2 coreutils
pip install git+git://github.com/conda/constructor@8c0121d3b81846de42973b52f13135f0ffeaddda#egg=constructor --force --no-deps
conda list

Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -ex

echo "***** Start: Testing Miniforge installer *****"

Expand Down

0 comments on commit 379c08b

Please sign in to comment.