Skip to content

Commit

Permalink
Add CI testing on GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelton committed May 8, 2021
1 parent c635947 commit 415fc0c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and test python-libssh

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '38 4 5 * *'

jobs:
build:
name: Run tests in container
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
os: [ fedora-33 ]
steps:
- uses: actions/checkout@v2
- name: Set the right OS in the Dockerfile
run: sed -i "s#^FROM.*#FROM $( echo ${{ matrix.os }} | sed 's#^fedora-#registry.fedoraproject.org/fedora:#' )#" tests/Dockerfile
- name: Build image
run: docker build -t python-libssh -f tests/Dockerfile .
- name: Run container
run: docker run --name python-libssh --rm -d python-libssh
- name: Run tests in the container
run: docker exec python-libssh python3 setup.py test
- name: Run tests with installed rpm
run: docker exec python-libssh bash -c 'cp -rp tests /tmp/tests && cd /tmp/tests && for i in *.py ; do python3 $i ; done'

0 comments on commit 415fc0c

Please sign in to comment.