-
Notifications
You must be signed in to change notification settings - Fork 11
130 lines (111 loc) · 3.59 KB
/
test.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: Test
on:
push:
branches: [main]
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-bin: ["python3"]
thumbor-version: ["7"]
include:
- python-version: "2.7"
python-version-desc: ""
python-bin: "python2"
thumbor-version: "6"
- python-version: "3.7"
python-version-desc: " (python 3.7)"
- python-version: "3.8"
python-version-desc: " (python 3.8)"
- python-version: "3.9"
python-version-desc: " (python 3.9)"
- python-version: "3.10"
python-version-desc: " (python 3.10)"
- python-version: "3.11"
python-version-desc: " (python 3.11)"
runs-on: ubuntu-latest
name: Thumbor ${{ matrix.thumbor-version }}${{ matrix.python-version-desc }}
env:
FFMPEG_BUILD_VER: 20210119-553eb07737
GIFSICLE_VER: 1.92
PYTEST_ADDOPTS: ${{ matrix.python-version == '2.7' && '--ignore=tests/result_storages/test_thumbor_aws_storage.py' || '' }}
container:
image: ${{ matrix.python-version == '2.7' && 'python:2.7-buster' || null }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != '2.7'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install python 2.7 container- specific dependencies
if: matrix.python-version == '2.7'
run: |
apt-get update
apt-get install -y sudo
- name: Install ffmpeg
run: |
curl -sLo - \
https://github.com/theatlantic/ffmpeg-build-script/releases/download/ffmpeg-${{ env.FFMPEG_BUILD_VER }}/ffmpeg-linux-${{ env.FFMPEG_BUILD_VER }}.tar.gz | \
sudo tar -C /usr/bin -zxf -
- name: Install gifsicle
run: |
curl -sLo - http://www.lcdf.org/gifsicle/gifsicle-1.92.tar.gz | \
tar Czxf . -
cd gifsicle-${{ env.GIFSICLE_VER }}
./configure --prefix=/usr
sudo make install
rm -rf gifsicle-${{ env.GIFSICLE_VER }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Install tox
run: |
${{ matrix.python-bin }} -m pip install --upgrade pip
${{ matrix.python-bin }} -m pip install tox tox-gh-actions wheel
- name: Run tests
run: |
tox -- -v
- name: Upload junit xml
if: always()
uses: actions/upload-artifact@v3
with:
name: junit-reports
path: reports/*.xml
- name: Combine coverage
if: matrix.python-version != '2.7'
run: tox -e coverage-report
- name: Upload coverage
uses: codecov/codecov-action@v3
if: matrix.python-version != '2.7'
with:
file: ./coverage.xml
name: ${{ github.workflow }}
token: ${{ secrets.CODECOV_TOKEN }}
report:
if: always()
needs: build
runs-on: ubuntu-latest
name: "Report Test Results"
steps:
- uses: actions/download-artifact@v3
with:
name: junit-reports
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: ./*.xml
report_individual_runs: true
check_name: "Unit Test Results"
success:
needs: build
runs-on: ubuntu-latest
name: Test Successful
steps:
- name: Success
run: echo Test Successful