1 |
commit: 0fa55427d252c5e41d1e3cbd28a86f530197eb02 |
2 |
Author: Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Sep 21 01:57:58 2021 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 21 20:59:24 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=0fa55427 |
7 |
|
8 |
Add github action unit-test CI |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoolkit/pull/16 |
11 |
Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail.com> |
12 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
13 |
|
14 |
.github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ |
15 |
1 file changed, 44 insertions(+) |
16 |
|
17 |
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml |
18 |
new file mode 100644 |
19 |
index 0000000..60b8205 |
20 |
--- /dev/null |
21 |
+++ b/.github/workflows/ci.yml |
22 |
@@ -0,0 +1,44 @@ |
23 |
+name: Unit tests |
24 |
+ |
25 |
+on: [push, pull_request] |
26 |
+ |
27 |
+jobs: |
28 |
+ build: |
29 |
+ |
30 |
+ runs-on: ubuntu-latest |
31 |
+ strategy: |
32 |
+ matrix: |
33 |
+ python-version: |
34 |
+ - '3.7' |
35 |
+ - '3.8' |
36 |
+ - '3.9' |
37 |
+ - '3.10.0-alpha - 3.10.0' |
38 |
+ - 'pypy-3.7' |
39 |
+ |
40 |
+ env: |
41 |
+ PORTAGE_VERSION: "3.0.20" |
42 |
+ |
43 |
+ steps: |
44 |
+ - uses: actions/checkout@v2 |
45 |
+ - name: Set up Python ${{ matrix.python-version }} |
46 |
+ uses: actions/setup-python@v2 |
47 |
+ with: |
48 |
+ python-version: ${{ matrix.python-version }} |
49 |
+ - name: Install portage |
50 |
+ run: | |
51 |
+ mkdir portage |
52 |
+ wget -qO - "https://github.com/gentoo/portage/archive/portage-${PORTAGE_VERSION}.tar.gz" | tar xz -C portage --strip-components=1 |
53 |
+ sudo groupadd -g 250 portage |
54 |
+ sudo useradd -g portage -d /var/tmp/portage -s /bin/false -u 250 portage |
55 |
+ - name: Setup gentoo env (required by portage) |
56 |
+ run: | |
57 |
+ sudo mkdir -p /var/db/repos/gentoo /etc/portage /var/cache/distfiles |
58 |
+ wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | sudo tar xz -C /var/db/repos/gentoo --strip-components=1 |
59 |
+ sudo wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd |
60 |
+ sudo wget "https://gitweb.gentoo.org/proj/portage.git/plain/cnf/repos.conf" -O /etc/portage/repos.conf |
61 |
+ sudo ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.1/systemd /etc/portage/make.profile |
62 |
+ - name: Run tests |
63 |
+ run: | |
64 |
+ export PYTHONPATH="${PWD}/portage/lib"${PYTHONPATH:+:}${PYTHONPATH} |
65 |
+ export PATH="${PWD}/portage/bin":${PATH} |
66 |
+ python setup.py test |