forked from shaka-project/shaka-streamer
-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (86 loc) · 2.96 KB
/
build_and_test.yaml
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
name: Build and Test PR
# Builds and tests on all combinations of OS and python version.
# Also builds the docs.
#
# Runs when a pull request is opened or updated.
#
# Can also be run manually for debugging purposes.
on:
# TODO: re-enable pull_request trigger
#pull_request:
# types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
ref:
description: "The ref to build and test."
required: False
defaults:
run:
shell: bash
jobs:
build_and_test:
strategy:
# Let other matrix entries complete, so we have all results on failure
# instead of just the first failure.
fail-fast: false
matrix:
# TODO: enable arm64
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Our minimum supported version of Python is currently 3.6.
python_version: ["3.6", "3.7", "3.8", "3.9"]
include:
- os: ubuntu-latest
os_name: linux
target_arch: x64
- os: macos-latest
os_name: osx
target_arch: x64
- os: windows-latest
os_name: win
target_arch: x64
name: Build and test ${{ matrix.os_name }} ${{ matrix.target_arch }} Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref || github.ref }}
- name: Set Python version
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: Debug Python version
run: python3 --version
- name: Install Python deps
run: |
python3 -m pip install --upgrade pyyaml sphinx flask mypy==0.812 wheel
if [[ '${{ runner.os }}' == 'Windows' ]]; then
python3 -m pip install --upgrade pywin32
fi
- name: Download binaries
run: |
# Fetch binaries locally instead of installing the release version of
# the binary package. This lets us test changes to the binary package
# before it is released.
python3 binaries/build_wheels.py
if [[ '${{ runner.os }}' == 'Windows' ]]; then
echo "PYTHONPATH=$GITHUB_WORKSPACE\\binaries;$PYTHONPATH" >> $GITHUB_ENV
else
echo "PYTHONPATH=$GITHUB_WORKSPACE/binaries:$PYTHONPATH" >> $GITHUB_ENV
fi
- name: Build docs (Linux only)
run: bash docs/build.sh
if: runner.os == 'Linux'
- name: Run tests
run: |
if [[ '${{ runner.os }}' == 'Linux' ]]; then
# Run without X11 on Linux by using xvfb.
WRAPPER="xvfb-run -a"
else
WRAPPER=""
fi
# Use the "spec" reporter for clearer logs in GitHub Actions
$WRAPPER python3 run_end_to_end_tests.py --reporters spec
#- name: Debug on failure
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}