This repository was archived by the owner on May 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
122 lines (107 loc) · 3.73 KB
/
CI.yml
File metadata and controls
122 lines (107 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: docker images build
on:
push:
workflow_dispatch:
jobs:
build_uwgeo_image:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
context: .
push: true
file: ./Dockerfile
platforms: linux/amd64
tags: underworldcode/uwgeodynamics:amd64
# Manifeset is still experimental - so comment out for now.
# - name: Update manifest
# run: |
# docker manifest create underworldcode/uwgeodynamics --amend underworldcode/uwgeodynamics:amd64 --amend underworldcode/uwgeodynamics:arm64
# docker manifest push underworldcode/uwgeodynamics
test_in_UW_Container:
name: Test in UW Container
runs-on: ubuntu-latest
container:
image: underworldcode/underworld2:latest
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test in UW Container
run: |
pip install -e .
pip install pytest
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 -l {0}
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 -l {0}
run: conda config --set anaconda_upload yes
- name: Upload new Packages
if: github.event_name == 'release'
shell: bash -l {0}
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
pypi:
runs-on: ${{ matrix.os }}
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: build wheel
if: ${{ matrix.os }} == 'ubuntu-latest'
run: |
pip install wheel
python setup.py bdist_wheel --universal
- name: build wheel
if: ${{ matrix.os }} == 'macos-latest'
run: |
pip install wheel
python setup.py bdist_wheel
- name: upload wheel
if: github.event_name == 'release'
run: |
pip install twine
python -m twine upload dist/*