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:
|
|
|
|
|
|
|
|
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:
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
python-version:
|
|
|
|
- 2.7
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
2020-11-25 13:16:37 +00:00
|
|
|
# Get vcpython27 on Windows + Python 2.7, to build netifaces
|
|
|
|
# extension. See https://chocolatey.org/packages/vcpython27 and
|
|
|
|
# https://github.com/crazy-max/ghaction-chocolatey
|
|
|
|
- name: Install MSVC 9.0 for Python 2.7 [Windows]
|
|
|
|
if: matrix.os == 'windows-latest' && matrix.python-version == '2.7'
|
|
|
|
uses: crazy-max/ghaction-chocolatey@v1
|
|
|
|
with:
|
|
|
|
args: install vcpython27
|
|
|
|
|
2020-02-17 20:35:56 +00:00
|
|
|
- name: Check out Tahoe-LAFS sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Fetch all history for all tags and branches
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install Python packages
|
|
|
|
run: |
|
|
|
|
pip install --upgrade codecov tox setuptools
|
|
|
|
pip list
|
|
|
|
|
|
|
|
- name: Display tool versions
|
|
|
|
run: python misc/build_helpers/show-tool-versions.py
|
|
|
|
|
2020-08-27 14:37:37 +00:00
|
|
|
- name: Run "tox -e py27-coverage"
|
|
|
|
run: tox -e py27-coverage
|
2020-02-17 20:35:56 +00:00
|
|
|
|
|
|
|
- name: Upload eliot.log in case of failure
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: eliot.log
|
|
|
|
path: eliot.log
|
|
|
|
|
2021-01-05 20:57:10 +00:00
|
|
|
# Upload this job's coverage data to Coveralls.
|
|
|
|
- name: "Report Coverage to Coveralls"
|
2021-01-06 01:09:46 +00:00
|
|
|
run: |
|
|
|
|
pip install coveralls
|
2021-01-06 20:48:20 +00:00
|
|
|
python -m coveralls --verbose
|
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
|
|
|
|
# multiple coverage results into a single report.
|
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.
|
|
|
|
finish-coverage-report:
|
|
|
|
# There happens to just be one coverage-collecting job at the moment. If
|
|
|
|
# the coverage reports are broken and someone added more
|
|
|
|
# coverage-collecting jobs to this workflow but didn't update this, that's
|
|
|
|
# why.
|
|
|
|
needs:
|
|
|
|
- "coverage"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
steps:
|
2021-01-06 20:58:48 +00:00
|
|
|
- name: "Check out Tahoe-LAFS sources"
|
|
|
|
uses: "actions/checkout@v2"
|
|
|
|
|
2021-01-05 20:57:10 +00:00
|
|
|
- name: "Finish Coveralls Reporting"
|
2021-01-06 01:09:46 +00:00
|
|
|
run: |
|
2021-01-06 19:33:00 +00:00
|
|
|
# coveralls-python does have a `--finish` option but it doesn't seem
|
|
|
|
# to work, at least for us.
|
|
|
|
# https://github.com/coveralls-clients/coveralls-python/issues/248
|
|
|
|
#
|
|
|
|
# But all it does is this simple POST so we can just send it
|
|
|
|
# ourselves. The only hard part is guessing what the POST
|
|
|
|
# parameters mean.
|
|
|
|
#
|
|
|
|
# Since the build is done I'm going to guess that "done" is a fine
|
|
|
|
# value for status.
|
|
|
|
#
|
|
|
|
# That leaves "build_num". The coveralls documentation gives some
|
|
|
|
# hints about it. It suggests using $CIRCLE_WORKFLOW_ID if your job
|
|
|
|
# is on CircleCI. CircleCI documentation says this about
|
|
|
|
# CIRCLE_WORKFLOW_ID:
|
|
|
|
#
|
|
|
|
# A unique identifier for the workflow instance of the current
|
|
|
|
# job. This identifier is the same for every job in a given
|
|
|
|
# workflow instance.
|
|
|
|
#
|
|
|
|
# (from https://circleci.com/docs/2.0/env-vars/)
|
|
|
|
#
|
|
|
|
# A CircleCI workflow is roughly "the group of jobs run for a
|
|
|
|
# particular commit". There are exceptions to this but maybe we can
|
|
|
|
# ignore them.
|
|
|
|
#
|
|
|
|
# The only over hints we get from Coveralls about "build_num" are:
|
|
|
|
#
|
|
|
|
# * An example value of `1234`
|
|
|
|
#
|
|
|
|
# * Another example value of `$BUILD_NUMBER` where BUILD_NUMBER is
|
|
|
|
# not defined anywhere.
|
|
|
|
#
|
|
|
|
# Starting from the CircleCI workflow example, then, and looking at
|
|
|
|
# the environment variables GitHub Actions offers
|
|
|
|
# (https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables) there are two of interest:
|
|
|
|
#
|
|
|
|
# * GITHUB_RUN_ID - A unique number for each run within a
|
|
|
|
# repository. This number does not change if you re-run the
|
|
|
|
# workflow run.
|
|
|
|
#
|
|
|
|
# * GITHUB_RUN_NUMBER - A unique number for each run of a particular
|
|
|
|
# workflow in a repository. This number begins at 1 for the
|
|
|
|
# workflow's first run, and increments with each new run. This
|
|
|
|
# number does not change if you re-run the workflow run.
|
|
|
|
#
|
|
|
|
# These seem to offer approximately the same value and only differ
|
|
|
|
# on whether they will be unique for the project as a whole or just
|
|
|
|
# for this particular workflow ("ci", as defined by this file).
|
|
|
|
#
|
|
|
|
# Unfortunately neither of them changes if a workflow is re-run.
|
|
|
|
# This differs from the behavior of CircleCI's CIRCLE_WORKFLOW_ID
|
|
|
|
# where a new value is assigned if a workflow is re-run.
|
|
|
|
#
|
|
|
|
# The consequence of this would seem to be that multiple runs of a
|
|
|
|
# GitHub Actions workflow will have their coverage reported to the
|
|
|
|
# same job. And since we eventually "finish" a job, later runs
|
|
|
|
# would be discarded (I suppose).
|
|
|
|
#
|
|
|
|
# There doesn't seem to be a way to do any better, though.
|
|
|
|
#
|
|
|
|
# However, we have the further constraint that our build_num must
|
2021-01-06 19:33:31 +00:00
|
|
|
# agree with whatever coveralls-python has selected. An inspection
|
2021-01-06 20:38:12 +00:00
|
|
|
# of the coveralls-python source suggests that GITHUB_RUN_ID is
|
|
|
|
# used. However, observation of the coveralls.io web interface
|
|
|
|
# suggests the value instead is something more like:
|
|
|
|
#
|
|
|
|
# $(git rev-parse refs/remotes/pull/<PR NUM>/merge)-PR-<PR NUM>
|
2021-01-06 19:33:00 +00:00
|
|
|
#
|
|
|
|
# Thus, we select the same.
|
2021-01-06 20:38:12 +00:00
|
|
|
#
|
|
|
|
# GITHUB_REF is a string like the rev being parsed above. We
|
|
|
|
# extract the PR number from it.
|
2021-01-06 21:15:02 +00:00
|
|
|
#
|
|
|
|
# actions/checkout@v2 makes HEAD the same as refs/remotes/pull/<PR
|
|
|
|
# NUM>/merge so we can just rev-parse that.
|
2021-01-06 20:38:12 +00:00
|
|
|
PR=$(echo $GITHUB_REF | cut -d / -f 4)
|
2021-01-06 21:15:02 +00:00
|
|
|
REV=$(git rev-parse HEAD)
|
2021-01-06 20:38:12 +00:00
|
|
|
BUILD_NUM=$REV-PR-$PR
|
|
|
|
REPO_NAME=$GITHUB_REPOSITORY
|
|
|
|
curl \
|
|
|
|
-k \
|
|
|
|
https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN \
|
|
|
|
-d \
|
|
|
|
"payload[build_num]=$BUILD_NUM&payload[status]=done&payload[repo_name]=$REPO_NAME"
|
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"
|
2020-02-26 04:05:03 +00:00
|
|
|
|
|
|
|
integration:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-latest
|
2020-06-22 20:27:18 +00:00
|
|
|
- windows-latest
|
2020-02-26 04:05:03 +00:00
|
|
|
python-version:
|
|
|
|
- 2.7
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
2020-11-25 13:16:37 +00:00
|
|
|
# Get vcpython27 for Windows + Python 2.7, to build netifaces
|
|
|
|
# extension. See https://chocolatey.org/packages/vcpython27 and
|
|
|
|
# https://github.com/crazy-max/ghaction-chocolatey
|
|
|
|
- name: Install MSVC 9.0 for Python 2.7 [Windows]
|
|
|
|
if: matrix.os == 'windows-latest' && matrix.python-version == '2.7'
|
|
|
|
uses: crazy-max/ghaction-chocolatey@v1
|
|
|
|
with:
|
|
|
|
args: install vcpython27
|
|
|
|
|
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
|
|
|
|
|
2020-02-26 04:17:45 +00:00
|
|
|
- name: Install Tor [macOS]
|
2020-02-26 04:05:03 +00:00
|
|
|
if: matrix.os == 'macos-latest'
|
|
|
|
run: brew install tor
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Fetch all history for all tags and branches
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install Python packages
|
|
|
|
run: |
|
|
|
|
pip install --upgrade tox
|
|
|
|
pip list
|
|
|
|
|
|
|
|
- name: Display tool versions
|
|
|
|
run: python misc/build_helpers/show-tool-versions.py
|
|
|
|
|
|
|
|
- name: Run "tox -e integration"
|
|
|
|
run: tox -e integration
|
|
|
|
|
|
|
|
- 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:
|
|
|
|
|
2020-11-25 13:16:37 +00:00
|
|
|
# Get vcpython27 for Windows + Python 2.7, to build netifaces
|
|
|
|
# extension. See https://chocolatey.org/packages/vcpython27 and
|
|
|
|
# https://github.com/crazy-max/ghaction-chocolatey
|
|
|
|
- name: Install MSVC 9.0 for Python 2.7 [Windows]
|
|
|
|
if: matrix.os == 'windows-latest' && matrix.python-version == '2.7'
|
|
|
|
uses: crazy-max/ghaction-chocolatey@v1
|
|
|
|
with:
|
|
|
|
args: install vcpython27
|
|
|
|
|
2020-02-26 04:10:26 +00:00
|
|
|
- name: Check out Tahoe-LAFS sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Fetch all history for all tags and branches
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- 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-*-*.*
|