Updates to codespaces (main) #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
release: | |
workflow_dispatch: | |
jobs: | |
build_carbonite_image: | |
name: Build Carbonite Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Update sha256 | |
run: | | |
docker pull underworldcode/base | |
SHA256=$(docker inspect --format='{{index .RepoDigests 0}}' underworldcode/base) | |
sed -i "/sha256/c\FROM ${SHA256} as base_runtime" Dockerfile | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Carbonite Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
file: ./docs/development/docker/underworld2/Dockerfile | |
platforms: linux/amd64 | |
tags: underworldcode/carbonite:amd64 | |
- name: Update manifest | |
run: | | |
docker manifest create underworldcode/carbonite --amend underworldcode/carbonite:amd64 --amend underworldcode/carbonite:arm64 | |
docker manifest push underworldcode/carbonite | |
test_in_UW_Container: | |
name: Test in Docker Container | |
if: always() | |
runs-on: ubuntu-latest | |
container: | |
image: underworldcode/base | |
options: --user root | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Underworld | |
run: | | |
pip install -vvv . | |
- name: Run Tests | |
run: | | |
pip install pytest | |
python -m pytest -vvv | |
conda_build: | |
name: Conda Build (Python ${{matrix.python-version}} ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest", "macos-latest"] | |
python-version: ["3.7", "3.8", "3.9"] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- name: Config Conda | |
shell: bash | |
run: | | |
conda install --channel conda-forge conda-build anaconda-client conda-verify | |
conda config --add channels conda-forge | |
conda config --add channels underworldcode | |
conda config --set anaconda_upload no | |
- name: Config Conda For Upload | |
if: github.event_name == 'release' | |
shell: bash | |
run: conda config --set anaconda_upload yes | |
- name: Upload new Packages | |
if: github.event_name == 'release' | |
shell: bash | |
run: | | |
anaconda login --hostname github-actions-${{ matrix.os }}-$RANDOM --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }} | |
conda-build --channel conda-forge --user geo-down-under conda | |
anaconda logout |