-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (76 loc) · 2.46 KB
/
ci.yml
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
name: CI
on:
push:
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Install conda
uses: s-weigand/setup-conda@v1
with:
python-version: 3.7
- name: Install tuttest
run: python3 -m pip install git+https://github.com/antmicro/tuttest@12ba1cf02ea327f99098005692d4311f0e02cda4#tuttest
- name: Checkout repository
uses: actions/checkout@v2
- name: Remove all files but README.rst and test directory
run: |
set -x
ls -ld *
GLOBIGNORE=README.rst:test
rm -rf *
unset GLOBIGNORE
ls -ld *
- name: Install conda-build-prepare with pip
# Revision from README is changed to the SHA of the commit being tested
run: eval "$(tuttest README.rst install_cbp | sed "s/\@[^#]\+#/\@$GITHUB_SHA#/")"
- name: Test prepare_package snippet
run: |
set -x
eval "$(tuttest README.rst set_envs)"
eval "$(tuttest README.rst prepare_package)"
tar cf ${DIRECTORY}.tar $DIRECTORY
- name: Print rendered meta.yaml
run: |
set -x
eval "$(tuttest README.rst set_envs)"
cat $DIRECTORY/recipe/meta.yaml
- name: Test build_package snippet
run: |
set -x
eval "$(tuttest README.rst set_envs)"
eval "$(conda shell.bash hook 2>/dev/null)"
eval "$(tuttest README.rst build_package)"
- name: Upload built PACKAGE if build succeeded
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_PACKAGE
path: '*/conda-env/conda-bld/*/*.tar.bz2'
# conda-build sometimes fail silently; this fails the build if there's no package and enables DIRECTORY upload
if-no-files-found: error
if: success()
- name: Compress DIRECTORY from before building if build failed
run: |
set -x
eval "$(tuttest README.rst set_envs)"
bzip2 ${DIRECTORY}.tar
if: failure()
- name: Upload DIRECTORY from before building if build failed
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_DIRECTORY
path: '*.tar.bz2'
if: failure()