ci: test with 3.9
[rarfile.git] / .github / workflows / ci.yml
blobff6f09635ce86ff3335ad4fdcd250eee7c9001d0
2 # https://docs.github.com/en/actions
3 # https://github.com/actions
6 name: CI
8 on:
9   pull_request: {}
10   push: {}
12 jobs:
14   lint:
15     name: "Lint - Ubuntu ${{matrix.pick.OS}} / Python ${{matrix.pick.PY}}"
16     runs-on: ubuntu-${{matrix.pick.OS}}
17     strategy:
18       matrix:
19         pick:
20           - {OS: "20.04", PY: "3.8", TOXENV: "lint,docs"}
21     steps:
22       - name: "Checkout"
23         uses: actions/checkout@v2
25       - name: "Setup Python ${{matrix.pick.PY}}"
26         uses: actions/setup-python@v2
27         with:
28           python-version: ${{matrix.pick.PY}}
30       - name: "Install tox"
31         run: |
32           python -m pip install tox wheel
34       - name: "Run tox - ${{matrix.pick.TOXENV}}"
35         env:
36           TOXENV: ${{matrix.pick.TOXENV}}
37         run: |
38           python -m tox -r -- --color=yes
40   linux:
41     name: "Test - Ubuntu ${{matrix.pick.OS}} / ${{matrix.pick.PYNAME}}"
42     runs-on: ubuntu-${{matrix.pick.OS}}
43     strategy:
44       matrix:
45         pick:
46           - {OS: "18.04", PY: "pypy3", PYNAME: "PyPy3", TOXENV: "pypy3"}
47           - {OS: "16.04", PY: "3.6", PYNAME: "Python 3.6", TOXENV: "py36-pycryptodome"}
48           - {OS: "18.04", PY: "3.7", PYNAME: "Python 3.7", TOXENV: "py37-cryptography"}
49           - {OS: "20.04", PY: "3.8", PYNAME: "Python 3.8", TOXENV: "py38-cryptography"}
50           - {OS: "20.04", PY: "3.9", PYNAME: "Python 3.9", TOXENV: "py39"}
51     steps:
52       - name: "Checkout"
53         uses: actions/checkout@v2
55       - name: "Setup ${{matrix.pick.PYNAME}}"
56         uses: actions/setup-python@v2
57         with:
58           python-version: ${{matrix.pick.PY}}
60       - name: "Install archivers"
61         run: sudo -nH apt-get -qqy install unrar unar libarchive-tools
63       - name: "Install tox"
64         run: |
65           python --version
66           python -m pip install tox wheel
68       - name: "Run tox - ${{matrix.pick.TOXENV}}"
69         env:
70           TOXENV: ${{matrix.pick.TOXENV}}
71         run: |
72           python -m tox -r -- --color=yes -n auto
74   macos:
75     name: "Test - MacOS ${{matrix.pick.OS}} / Python ${{matrix.pick.PY}}"
76     runs-on: macos-${{matrix.pick.OS}}
77     strategy:
78       matrix:
79         pick:
80           - {OS: "10.15", PY: "3.8", TOXENV: "py38-cryptography", DL_UNRAR: false, DL_UNAR: false}
81     steps:
82       - name: "Checkout"
83         uses: actions/checkout@v2
85       - name: "Setup Python ${{matrix.pick.PY}}"
86         uses: actions/setup-python@v2
87         with:
88           python-version: ${{matrix.pick.PY}}
90       - name: "Install archivers"
91         run: |
92           brew install unrar unar libarchive
93           mkdir -p bin
94           echo "::add-path::${GITHUB_WORKSPACE}/bin"
96       - name: "Download unrar"
97         if: matrix.pick.DL_UNRAR
98         run: |
99           curl -sS -o "rarosx.tgz" "https://www.rarlab.com/rar/rarosx-5.9.1.tar.gz"
100           tar xvf "rarosx.tgz" "rar/unrar"
102       - name: "Download unar"
103         if: matrix.pick.DL_UNAR
104         run: |
105           curl -sS -o "unarMac.zip" "https://cdn.theunarchiver.com/downloads/unarMac.zip"
106           unzip "unarMac.zip" "unar"
107           install -m 755 unar ./bin/
108           rm unar
110       - name: "Install tox"
111         run: |
112           python -m pip install tox wheel
114       - name: "Run tox - ${{matrix.pick.TOXENV}}"
115         env:
116           TOXENV: ${{matrix.pick.TOXENV}}
117         run: |
118           python -m tox -r -- --color=yes -n auto
120   windows:
121     name: "Test - Windows ${{matrix.pick.OS}} / Python ${{matrix.pick.PY}}"
122     runs-on: windows-${{matrix.pick.OS}}
123     strategy:
124       matrix:
125         pick:
126           - {OS: "2016", PY: "3.6", TOXENV: "py36", DL_UNRAR: false, DL_UNAR: false}
127           - {OS: "2019", PY: "3.8", TOXENV: "py38-cryptography", DL_UNRAR: false, DL_UNAR: false}
128     steps:
129       - name: "Checkout"
130         uses: actions/checkout@v2
132       - name: "Setup Python ${{matrix.pick.PY}}"
133         uses: actions/setup-python@v2
134         with:
135           python-version: ${{matrix.pick.PY}}
137       - name: "Setup MSYS"
138         shell: cmd
139         run: |
140           echo "temp add MSYS to PATH"
141           echo ::set-env name=OLDP::%PATH%
142           echo ::add-path::C:\msys64\usr\bin
144       - name: "Install unrar, bsdtar"
145         shell: bash
146         run: |
147           pacman -S --noconfirm --needed unrar bsdtar
148           mkdir bin
149           install -m 755 /c/msys64/usr/bin/unrar.exe bin/
150           install -m 755 /c/msys64/usr/bin/bsdtar.exe bin/
151           # reset PATH
152           echo "::add-path::${OLDP}"
154       - name: "Download unrar"
155         if: matrix.pick.DL_UNRAR
156         shell: bash
157         run: |
158           curl -sS -o "unrarw32.exe" "https://www.rarlab.com/rar/unrarw32.exe"
159           7z x "unrarw32.exe"
160           echo "::add-path::${GITHUB_WORKSPACE}\\rar"
162       # need at least unar >= 1.10
163       - name: "Download unar"
164         if: matrix.pick.DL_UNAR
165         shell: bash
166         run: |
167           curl -sS -o "unarWindows.zip" "https://cdn.theunarchiver.com/downloads/unarWindows.zip"
168           unzip -q -d unar "unarWindows.zip"
169           echo "::add-path::${GITHUB_WORKSPACE}\\unar"
171       - name: "Install tox"
172         shell: cmd
173         run: |
174           python -m pip install tox wheel
176       - name: "Run tox - ${{matrix.pick.TOXENV}}"
177         shell: cmd
178         env:
179           TOXENV: ${{matrix.pick.TOXENV}}
180         run: |
181           python -m tox -r -- --color=yes -n auto