diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f4e7440 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,123 @@ +name: test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +permissions: + contents: read + +jobs: + download: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install test dependencies + run: ./scripts/ci-install.sh + + - name: Upload test dependencies + uses: actions/upload-artifact@v4 + with: + name: test-dependencies + path: tests/data/ux.stackexchange.com.7z + if-no-files-found: error + compression-level: 0 + + python2: + needs: download + + runs-on: ubuntu-latest + container: + image: python:2.7.18-buster + + strategy: + fail-fast: false + matrix: + python-version: + - "2.7" + + steps: + - uses: actions/checkout@v4 + + - name: Build module + run: python setup.py build + + - name: Download test dependencies + uses: actions/download-artifact@v4 + with: + name: test-dependencies + path: tests/data + + - name: Run tests + run: python setup.py test + + python3-old: + needs: download + + runs-on: ubuntu-20.04 + + strategy: + fail-fast: false + matrix: + python-version: + - "3.5" + - "3.6" + - "3.7" + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Build module + run: python setup.py build + + - name: Download test dependencies + uses: actions/download-artifact@v4 + with: + name: test-dependencies + path: tests/data + + - name: Run tests + run: python setup.py test + + python3: + needs: download + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Build module + run: python setup.py build + + - name: Download test dependencies + uses: actions/download-artifact@v4 + with: + name: test-dependencies + path: tests/data + + - name: Run tests + run: python setup.py test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2a4c8fd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -# stats available at -# https://travis-ci.org/fancycode/pylzma -language: python -sudo: false - -matrix: - include: - - os: linux - python: 2.6 - - os: linux - python: 2.7 - - os: linux - python: 3.3 - - os: linux - python: 3.4 - - os: linux - python: 3.5-dev - - os: linux - python: nightly - - os: osx - language: generic - env: PYVER=2 - - os: osx - language: generic - env: PYVER=3 - -env: - - CC=/usr/lib/ccache/gcc CXX=/usr/lib/ccache/g++ - -addons: - apt: - packages: - - ccache - -cache: - directories: - - $HOME/.ccache - - $HOME/.downloads - -install: - - ./scripts/ci-install.sh - -script: - - python$PYVER setup.py test diff --git a/README.md b/README.md index 6f7c8d8..3e2bf36 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * **7-Zip** Copyright (C) 1999-2010 Igor Pavlov * **LZMA SDK** Copyright (C) 1999-2010 Igor Pavlov -[![Linux Build Status](https://travis-ci.org/fancycode/pylzma.svg?branch=master)](https://travis-ci.org/fancycode/pylzma) +[![Linux Build Status](https://github.com/fancycode/pylzma/workflows/test/badge.svg)](https://github.com/fancycode/pylzma/actions) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/5a7k7v9k2a0eiuom/branch/master?svg=true )](https://ci.appveyor.com/project/fancycode/pylzma) diff --git a/scripts/ci-install.sh b/scripts/ci-install.sh index 324ead8..42fa8b7 100755 --- a/scripts/ci-install.sh +++ b/scripts/ci-install.sh @@ -1,22 +1,6 @@ #!/bin/bash set -e -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then - if [[ $PYVER == '2' ]]; then - formula="python${PYVER}" - else - formula="python" - fi - # Update Python if already installed, otherwise install. - echo "Installing / updating ${formula} ..." - if [[ $PYVER == '3' ]]; then - brew list "${formula}" &>/dev/null && brew upgrade "${formula}" - fi - brew list "${formula}" &>/dev/null || brew install "${formula}" - echo -n "Using: " - "python$PYVER" --version -fi - echo "Downloading ux.stackexchange.com.7z ..." mkdir -p $HOME/.downloads ( cd $HOME/.downloads && wget --no-check-certificate --timestamping https://archive.org/download/stackexchange/ux.stackexchange.com.7z )