2020-02-17 20:35:56 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-04-13 16:19:41 +00:00
|
|
|
branches:
|
|
|
|
- "master"
|
2020-02-17 20:35:56 +00:00
|
|
|
pull_request:
|
|
|
|
|
2021-02-23 14:52:30 +00:00
|
|
|
env:
|
|
|
|
# Tell Hypothesis which configuration we want it to use.
|
|
|
|
TAHOE_LAFS_HYPOTHESIS_PROFILE: "ci"
|
|
|
|
|
2020-02-17 20:35:56 +00:00
|
|
|
jobs:
|
2020-02-26 04:02:02 +00:00
|
|
|
|
|
|
|
coverage:
|
2020-02-17 20:35:56 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
2021-05-25 18:12:40 +00:00
|
|
|
- windows-latest
|
2021-03-31 19:54:31 +00:00
|
|
|
- ubuntu-latest
|
2020-02-17 20:35:56 +00:00
|
|
|
python-version:
|
|
|
|
- 2.7
|
2021-03-31 20:42:39 +00:00
|
|
|
- 3.6
|
2021-05-05 13:47:28 +00:00
|
|
|
- 3.7
|
|
|
|
- 3.8
|
|
|
|
- 3.9
|
2021-07-07 21:47:39 +00:00
|
|
|
include:
|
|
|
|
# On macOS don't bother with 3.6-3.8, just to get faster builds.
|
|
|
|
- os: macos-latest
|
|
|
|
python-version: 2.7
|
|
|
|
- os: macos-latest
|
|
|
|
python-version: 3.9
|
2020-02-17 20:35:56 +00:00
|
|
|
|
|
|
|
steps:
|
2021-01-18 22:54:17 +00:00
|
|
|
# See https://github.com/actions/checkout. A fetch-depth of 0
|
|
|
|
# fetches all tags and branches.
|
2020-02-17 20:35:56 +00:00
|
|
|
- name: Check out Tahoe-LAFS sources
|
|
|
|
uses: actions/checkout@v2
|
2021-01-18 22:54:17 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-02-17 20:35:56 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2021-05-05 14:06:35 +00:00
|
|
|
uses: actions/setup-python@v2
|
2020-02-17 20:35:56 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
2021-01-18 22:55:07 +00:00
|
|
|
# To use pip caching with GitHub Actions in an OS-independent
|
|
|
|
# manner, we need `pip cache dir` command, which became
|
|
|
|
# available since pip v20.1+. At the time of writing this,
|
|
|
|
# GitHub Actions offers pip v20.3.3 for both ubuntu-latest and
|
|
|
|
# windows-latest, and pip v20.3.1 for macos-latest.
|
2021-01-18 16:02:55 +00:00
|
|
|
- name: Get pip cache directory
|
|
|
|
id: pip-cache
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
|
2021-01-18 22:55:07 +00:00
|
|
|
# See https://github.com/actions/cache
|
2021-01-18 16:08:56 +00:00
|
|
|
- name: Use pip cache
|
2021-01-18 16:02:55 +00:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
|
2020-02-17 20:35:56 +00:00
|
|
|
- name: Install Python packages
|
|
|
|
run: |
|
2021-05-05 14:06:35 +00:00
|
|
|
pip install --upgrade codecov tox tox-gh-actions setuptools
|
2020-02-17 20:35:56 +00:00
|
|
|
pip list
|
|
|
|
|
|
|
|
- name: Display tool versions
|
|
|
|
run: python misc/build_helpers/show-tool-versions.py
|
|
|
|
|
2021-05-05 14:06:35 +00:00
|
|
|
- name: Run tox for corresponding Python version
|
|
|
|
run: python -m tox
|
2020-02-17 20:35:56 +00:00
|
|
|
|
2021-09-08 13:15:13 +00:00
|
|
|
- name: Upload eliot.log
|
2020-02-17 20:35:56 +00:00
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: eliot.log
|
|
|
|
path: eliot.log
|
|
|
|
|
2021-09-08 13:15:02 +00:00
|
|
|
- name: Upload trial log
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: _trial_temp/test.log
|
|
|
|
path: _trial_temp/test.log
|
|
|
|
|
2021-01-08 13:52:38 +00:00
|
|
|
# Upload this job's coverage data to Coveralls. While there is a GitHub
|
|
|
|
# Action for this, as of Jan 2021 it does not support Python coverage
|
|
|
|
# files - only lcov files. Therefore, we use coveralls-python, the
|
|
|
|
# coveralls.io-supplied Python reporter, for this.
|
2021-03-27 14:03:12 +00:00
|
|
|
#
|
|
|
|
# It is coveralls-python 1.x that has maintained compatibility
|
|
|
|
# with Python 2, while coveralls-python 3.x is compatible with
|
|
|
|
# Python 3. Sadly we can't use them both in the same workflow.
|
|
|
|
#
|
|
|
|
# The two versions of coveralls-python are somewhat mutually
|
|
|
|
# incompatible. Mixing these two different versions when
|
|
|
|
# reporting coverage to coveralls.io will lead to grief, since
|
|
|
|
# they get job IDs in different fashion. If we use both
|
|
|
|
# versions of coveralls in the same workflow, the finalizing
|
|
|
|
# step will be able to mark only part of the jobs as done, and
|
2021-03-27 14:21:34 +00:00
|
|
|
# the other part will be left hanging, never marked as done: it
|
|
|
|
# does not matter if we make an API call or `coveralls --finish`
|
|
|
|
# to indicate that CI has finished running.
|
2021-03-27 14:03:12 +00:00
|
|
|
#
|
2021-03-27 14:21:34 +00:00
|
|
|
# So we try to use the newer coveralls-python that is available
|
|
|
|
# via Python 3 (which is present in GitHub Actions tool cache,
|
|
|
|
# even when we're running Python 2.7 tests) throughout this
|
|
|
|
# workflow.
|
2021-01-05 20:57:10 +00:00
|
|
|
- name: "Report Coverage to Coveralls"
|
2021-01-06 01:09:46 +00:00
|
|
|
run: |
|
2021-03-27 14:03:12 +00:00
|
|
|
pip3 install --upgrade coveralls==3.0.1
|
2021-03-31 23:16:58 +00:00
|
|
|
python3 -m coveralls
|
2021-01-06 01:09:46 +00:00
|
|
|
env:
|
|
|
|
# Some magic value required for some magic reason.
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
# Help coveralls identify our project.
|
|
|
|
COVERALLS_REPO_TOKEN: "JPf16rLB7T2yjgATIxFzTsEgMdN1UNq6o"
|
2021-01-05 20:57:10 +00:00
|
|
|
# Every source of coverage reports needs a unique "flag name".
|
|
|
|
# Construct one by smashing a few variables from the matrix together
|
|
|
|
# here.
|
2021-01-06 01:09:46 +00:00
|
|
|
COVERALLS_FLAG_NAME: "run-${{ matrix.os }}-${{ matrix.python-version }}"
|
2021-01-05 20:57:10 +00:00
|
|
|
# Mark the data as just one piece of many because we have more than
|
|
|
|
# one instance of this job (Windows, macOS) which collects and
|
|
|
|
# reports coverage. This is necessary to cause Coveralls to merge
|
2021-01-08 13:27:00 +00:00
|
|
|
# multiple coverage results into a single report. Note the merge
|
|
|
|
# only happens when we "finish" a particular build, as identified by
|
|
|
|
# its "build_num" (aka "service_number").
|
2021-01-06 01:09:46 +00:00
|
|
|
COVERALLS_PARALLEL: true
|
2021-01-05 20:57:10 +00:00
|
|
|
|
|
|
|
# Tell Coveralls that we're done reporting coverage data. Since we're using
|
|
|
|
# the "parallel" mode where more than one coverage data file is merged into
|
|
|
|
# a single report, we have to tell Coveralls when we've uploaded all of the
|
|
|
|
# data files. This does it. We make sure it runs last by making it depend
|
|
|
|
# on *all* of the coverage-collecting jobs.
|
2021-03-27 14:17:22 +00:00
|
|
|
#
|
|
|
|
# See notes about parallel builds on GitHub Actions at
|
|
|
|
# https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html
|
2021-01-05 20:57:10 +00:00
|
|
|
finish-coverage-report:
|
2021-03-31 15:53:02 +00:00
|
|
|
needs:
|
|
|
|
- "coverage"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
container: "python:3-slim"
|
2021-01-05 20:57:10 +00:00
|
|
|
steps:
|
2021-03-27 14:17:22 +00:00
|
|
|
- name: "Indicate completion to coveralls.io"
|
2021-01-06 01:09:46 +00:00
|
|
|
run: |
|
2021-03-27 14:17:22 +00:00
|
|
|
pip3 install --upgrade coveralls==3.0.1
|
2021-03-31 23:16:58 +00:00
|
|
|
python3 -m coveralls --finish
|
2021-01-06 01:09:46 +00:00
|
|
|
env:
|
|
|
|
# Some magic value required for some magic reason.
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
2020-02-26 04:05:03 +00:00
|
|
|
|
|
|
|
integration:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
2020-06-22 20:27:18 +00:00
|
|
|
- windows-latest
|
2021-06-10 14:47:17 +00:00
|
|
|
- ubuntu-latest
|
2020-02-26 04:05:03 +00:00
|
|
|
python-version:
|
|
|
|
- 2.7
|
2021-06-10 14:47:17 +00:00
|
|
|
- 3.6
|
|
|
|
- 3.9
|
2021-07-07 21:47:39 +00:00
|
|
|
include:
|
|
|
|
# On macOS don't bother with 3.6, just to get faster builds.
|
|
|
|
- os: macos-latest
|
|
|
|
python-version: 2.7
|
|
|
|
- os: macos-latest
|
|
|
|
python-version: 3.9
|
2020-02-26 04:05:03 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
|
2020-02-26 04:17:45 +00:00
|
|
|
- name: Install Tor [Ubuntu]
|
2020-02-26 04:05:03 +00:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
run: sudo apt install tor
|
2021-07-05 12:37:49 +00:00
|
|
|
|
|
|
|
# TODO: See https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3744.
|
|
|
|
# We have to use an older version of Tor for running integration
|
2021-07-06 17:04:55 +00:00
|
|
|
# tests on macOS.
|
2021-07-05 12:37:49 +00:00
|
|
|
- name: Install Tor [macOS, ${{ matrix.python-version }} ]
|
2021-07-06 17:04:55 +00:00
|
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
2021-07-05 12:37:49 +00:00
|
|
|
run: |
|
|
|
|
brew extract --version 0.4.5.8 tor homebrew/cask
|
|
|
|
brew install tor@0.4.5.8
|
|
|
|
brew link --overwrite tor@0.4.5.8
|
2020-02-26 04:05:03 +00:00
|
|
|
|
2020-02-26 04:17:45 +00:00
|
|
|
- name: Install Tor [Windows]
|
2020-02-26 04:05:03 +00:00
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
uses: crazy-max/ghaction-chocolatey@v1
|
|
|
|
with:
|
|
|
|
args: install tor
|
|
|
|
|
|
|
|
- name: Check out Tahoe-LAFS sources
|
|
|
|
uses: actions/checkout@v2
|
2021-01-18 22:54:17 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-02-26 04:05:03 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2021-04-26 16:00:11 +00:00
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
2021-01-18 16:02:55 +00:00
|
|
|
- name: Get pip cache directory
|
|
|
|
id: pip-cache
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
|
2021-01-18 16:08:56 +00:00
|
|
|
- name: Use pip cache
|
2021-01-18 16:02:55 +00:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
|
2020-02-26 04:05:03 +00:00
|
|
|
- name: Install Python packages
|
|
|
|
run: |
|
|
|
|
pip install --upgrade tox
|
|
|
|
pip list
|
|
|
|
|
|
|
|
- name: Display tool versions
|
|
|
|
run: python misc/build_helpers/show-tool-versions.py
|
|
|
|
|
2021-05-13 14:25:48 +00:00
|
|
|
- name: Run "Python 2 integration tests"
|
|
|
|
if: ${{ matrix.python-version == '2.7' }}
|
2020-02-26 04:05:03 +00:00
|
|
|
run: tox -e integration
|
|
|
|
|
2021-05-13 14:25:48 +00:00
|
|
|
- name: Run "Python 3 integration tests"
|
|
|
|
if: ${{ matrix.python-version != '2.7' }}
|
|
|
|
run: tox -e integration3
|
|
|
|
|
2020-02-26 04:05:03 +00:00
|
|
|
- name: Upload eliot.log in case of failure
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
if: failure()
|
|
|
|
with:
|
2020-02-26 14:11:23 +00:00
|
|
|
name: integration.eliot.json
|
|
|
|
path: integration.eliot.json
|
2020-02-26 04:05:03 +00:00
|
|
|
|
2020-02-26 04:10:26 +00:00
|
|
|
packaging:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
- ubuntu-latest
|
|
|
|
python-version:
|
|
|
|
- 2.7
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Check out Tahoe-LAFS sources
|
|
|
|
uses: actions/checkout@v2
|
2021-01-18 22:54:17 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-02-26 04:10:26 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
2021-01-18 16:02:55 +00:00
|
|
|
- name: Get pip cache directory
|
|
|
|
id: pip-cache
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
|
2021-01-18 16:08:56 +00:00
|
|
|
- name: Use pip cache
|
2021-01-18 16:02:55 +00:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
|
2020-02-26 04:10:26 +00:00
|
|
|
- name: Install Python packages
|
|
|
|
run: |
|
2020-05-13 16:06:11 +00:00
|
|
|
pip install --upgrade tox
|
2020-02-26 04:10:26 +00:00
|
|
|
pip list
|
|
|
|
|
|
|
|
- name: Display tool versions
|
|
|
|
run: python misc/build_helpers/show-tool-versions.py
|
|
|
|
|
|
|
|
- name: Run "tox -e pyinstaller"
|
|
|
|
run: tox -e pyinstaller
|
2020-05-12 22:15:17 +00:00
|
|
|
|
|
|
|
# This step is to ensure there are no packaging/import errors.
|
|
|
|
- name: Test PyInstaller executable
|
|
|
|
run: dist/Tahoe-LAFS/tahoe --version
|
2020-05-12 22:37:50 +00:00
|
|
|
|
|
|
|
- name: Upload PyInstaller package
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Tahoe-LAFS-${{ matrix.os }}-Python-${{ matrix.python-version }}
|
|
|
|
path: dist/Tahoe-LAFS-*-*.*
|