-
Notifications
You must be signed in to change notification settings - Fork 159
130 lines (110 loc) · 3.88 KB
/
build-and-test-windows.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
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
123
124
125
126
127
128
129
130
name: Windows
on:
push:
branches:
- main
- /^rel\-*/
pull_request:
branches:
- main
jobs:
setup:
name: Prepare environment
runs-on: ubuntu-latest
env:
DT_HARNESS: GitHub
DT_BUILD_ID: ${{ github.run_id }}
DT_BUILD_NUMBER: ''
DT_BUILD_SUFFIX: ''
DT_RELEASE: ''
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Find build id
run: |
echo "DT_BUILD_ID=$(($(git rev-list --count origin/main) - 1))" >> $GITHUB_ENV
- name: Prepare environment variables
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
if [[ "$GITHUB_HEAD_REF" =~ ^rel- ]]; then
echo "DT_RELEASE=True" >> $GITHUB_ENV
else
echo "DT_BUILD_SUFFIX=PR$GITHUB_EVENT_NUMBER.$DT_BUILD_ID" >> $GITHUB_ENV
fi
elif [ "$GITHUB_REF" == "refs/heads/main" ]; then
echo "DT_BUILD_NUMBER=$DT_BUILD_ID" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" =~ ^refs/heads/rel- ]]; then
echo "DT_RELEASE=True" >> $GITHUB_ENV
else
echo "DT_BUILD_SUFFIX=$GITHUB_REF.$DT_BUILD_ID" >> $GITHUB_ENV
fi
- name: Print environment
run: |
echo "GITHUB_EVENT_NAME = $GITHUB_EVENT_NAME"
echo "GITHUB_EVENT_NUMBER = $GITHUB_EVENT_NUMBER"
echo "GITHUB_REF = $GITHUB_REF"
echo "GITHUB_HEAD_REF = $GITHUB_HEAD_REF"
echo "DT_HARNESS = $DT_HARNESS"
echo "DT_BUILD_ID = $DT_BUILD_ID"
echo "DT_RELEASE = $DT_RELEASE"
echo "DT_BUILD_SUFFIX = $DT_BUILD_SUFFIX"
echo "DT_BUILD_NUMBER = $DT_BUILD_NUMBER"
- name: Store environment into the output
id: store
run: |
echo "DT_BUILD_ID=$DT_BUILD_ID" >> $GITHUB_OUTPUT
echo "DT_RELEASE=$DT_RELEASE" >> $GITHUB_OUTPUT
echo "DT_BUILD_SUFFIX=$DT_BUILD_SUFFIX" >> $GITHUB_OUTPUT
echo "DT_BUILD_NUMBER=$DT_BUILD_NUMBER" >> $GITHUB_OUTPUT
outputs:
DT_HARNESS: Github
DT_BUILD_ID: ${{ steps.store.outputs.DT_BUILD_ID }}
DT_RELEASE: ${{ steps.store.outputs.DT_RELEASE }}
DT_BUILD_SUFFIX: ${{ steps.store.outputs.DT_BUILD_SUFFIX }}
DT_BUILD_NUMBER: ${{ steps.store.outputs.DT_BUILD_NUMBER }}
build-38:
name: Build and test on Python 3.8
runs-on: windows-latest
needs: setup
env:
DT_HARNESS: ${{ needs.setup.outputs.DT_HARNESS }}
DT_BUILD_ID: ${{ needs.setup.outputs.DT_BUILD_ID }}
DT_RELEASE: ${{ needs.setup.outputs.DT_RELEASE }}
DT_BUILD_SUFFIX: ${{ needs.setup.outputs.DT_BUILD_SUFFIX }}
DT_BUILD_NUMBER: ${{ needs.setup.outputs.DT_BUILD_NUMBER }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Build datatable wheel
run: |
python -V
python -m pip install --upgrade pip
python ci/ext.py wheel
echo "DT_WHEEL=$(ls dist/*-cp38-*.whl)" >> $env:GITHUB_ENV
- name: Print build information
run: |
echo "DT_WHEEL = $env:DT_WHEEL"
cat src/datatable/_build_info.py
- name: Save wheel artifact
uses: actions/upload-artifact@v2
with:
name: wheel-3.8
path: ${{ env.DT_WHEEL }}
- name: Install and test
run: |
python -m pip install $env:DT_WHEEL
python -m pip install pytest docutils pandas pyarrow
python -m pytest -ra --maxfail=10 -Werror -vv --showlocals ./tests/
- name: Uninstall wheel
run: python -m pip uninstall -y $env:DT_WHEEL
build-39:
name: Build and test on Python 3.9
runs-on: windows-latest
needs: setup
if: ${{ needs.setup.outputs.DT_RELEASE == 'True?' }}