aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang E. Sanyer <WolfgangESanyer@gmail.com>2021-09-20 21:57:58 -0400
committerMatt Turner <mattst88@gentoo.org>2021-09-21 13:59:24 -0700
commit0fa55427d252c5e41d1e3cbd28a86f530197eb02 (patch)
tree0247aa658b77da62680658e8625b42c7b13277a9 /.github
parentREADME.md: Improve formatting and remove gentoolkit-dev refs (diff)
downloadgentoolkit-0fa55427d252c5e41d1e3cbd28a86f530197eb02.tar.gz
gentoolkit-0fa55427d252c5e41d1e3cbd28a86f530197eb02.tar.bz2
gentoolkit-0fa55427d252c5e41d1e3cbd28a86f530197eb02.zip
Add github action unit-test CI
Closes: https://github.com/gentoo/gentoolkit/pull/16 Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com> Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..60b8205
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,44 @@
+name: Unit tests
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version:
+ - '3.7'
+ - '3.8'
+ - '3.9'
+ - '3.10.0-alpha - 3.10.0'
+ - 'pypy-3.7'
+
+ env:
+ PORTAGE_VERSION: "3.0.20"
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install portage
+ run: |
+ mkdir portage
+ wget -qO - "https://github.com/gentoo/portage/archive/portage-${PORTAGE_VERSION}.tar.gz" | tar xz -C portage --strip-components=1
+ sudo groupadd -g 250 portage
+ sudo useradd -g portage -d /var/tmp/portage -s /bin/false -u 250 portage
+ - name: Setup gentoo env (required by portage)
+ run: |
+ sudo mkdir -p /var/db/repos/gentoo /etc/portage /var/cache/distfiles
+ wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | sudo tar xz -C /var/db/repos/gentoo --strip-components=1
+ sudo wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd
+ sudo wget "https://gitweb.gentoo.org/proj/portage.git/plain/cnf/repos.conf" -O /etc/portage/repos.conf
+ sudo ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.1/systemd /etc/portage/make.profile
+ - name: Run tests
+ run: |
+ export PYTHONPATH="${PWD}/portage/lib"${PYTHONPATH:+:}${PYTHONPATH}
+ export PATH="${PWD}/portage/bin":${PATH}
+ python setup.py test