2020-11-28 10:32:38 +00:00
|
|
|
name: 'Test'
|
2020-07-03 20:52:28 +00:00
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2020-11-28 10:32:38 +00:00
|
|
|
pytest:
|
2020-07-22 23:30:36 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest]
|
|
|
|
python: [3.7, 3.8]
|
2020-07-03 20:52:28 +00:00
|
|
|
|
|
|
|
steps:
|
2020-07-22 23:30:36 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-07-03 20:52:28 +00:00
|
|
|
with:
|
2020-11-28 10:48:45 +00:00
|
|
|
submodules: true
|
2020-07-03 20:52:28 +00:00
|
|
|
fetch-depth: 1
|
|
|
|
|
2020-08-14 02:23:27 +00:00
|
|
|
### Setup Python & JS Languages
|
2020-07-22 23:30:36 +00:00
|
|
|
- name: Set up Python ${{ matrix.python }}
|
2020-07-03 20:52:28 +00:00
|
|
|
uses: actions/setup-python@v1
|
|
|
|
with:
|
2020-07-22 23:30:36 +00:00
|
|
|
python-version: ${{ matrix.python }}
|
2020-07-03 20:52:28 +00:00
|
|
|
architecture: x64
|
2020-07-22 23:30:36 +00:00
|
|
|
|
2020-08-14 02:23:27 +00:00
|
|
|
- name: Set up Node JS 14.7.0
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 14.7.0
|
|
|
|
|
|
|
|
### Install Python & JS Dependencies
|
2020-08-05 18:30:20 +00:00
|
|
|
- name: Get pip cache dir
|
|
|
|
id: pip-cache
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
|
2020-07-31 16:06:20 +00:00
|
|
|
- name: Cache pip
|
2020-07-28 04:13:10 +00:00
|
|
|
uses: actions/cache@v2
|
2020-07-31 16:06:20 +00:00
|
|
|
id: cache-pip
|
2020-07-22 23:30:36 +00:00
|
|
|
with:
|
2020-08-05 18:30:20 +00:00
|
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
2020-07-28 04:13:10 +00:00
|
|
|
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('setup.py') }}
|
2020-07-22 23:30:36 +00:00
|
|
|
restore-keys: |
|
2020-07-28 04:13:10 +00:00
|
|
|
${{ runner.os }}-${{ matrix.python }}-venv-
|
2020-07-22 23:30:36 +00:00
|
|
|
|
2020-08-14 04:35:43 +00:00
|
|
|
- name: Install pip dependencies
|
2020-08-14 02:23:27 +00:00
|
|
|
run: |
|
2020-11-28 09:29:06 +00:00
|
|
|
python -m pip install --upgrade pip setuptools wheel pytest bottle
|
|
|
|
./bin/build_pip.sh
|
|
|
|
python -m pip install .
|
2020-08-14 02:23:27 +00:00
|
|
|
|
|
|
|
- name: Get npm cache dir
|
|
|
|
id: npm-cache
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=dir::$GITHUB_WORKSPACE/node_modules"
|
|
|
|
|
|
|
|
- name: Cache npm
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache-npm
|
2020-08-04 14:01:17 +00:00
|
|
|
with:
|
2020-08-14 02:23:27 +00:00
|
|
|
path: ${{ steps.npm-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node_modules
|
|
|
|
|
|
|
|
- name: Install npm requirements
|
|
|
|
run: |
|
|
|
|
npm install
|
2020-10-23 11:54:37 +00:00
|
|
|
echo "SINGLEFILE_BINARY=$GITHUB_WORKSPACE/node_modules/.bin/single-file" >> $GITHUB_ENV
|
|
|
|
echo "READABILITY_BINARY=$GITHUB_WORKSPACE/node_modules/.bin/readability-extractor" >> $GITHUB_ENV
|
|
|
|
echo "MERCURY_BINARY=$GITHUB_WORKSPACE/node_modules/.bin/mercury-parser" >> $GITHUB_ENV
|
2020-08-04 14:01:17 +00:00
|
|
|
|
2020-08-14 02:23:27 +00:00
|
|
|
### Run the tests
|
|
|
|
- name: Directory listing for debugging
|
2020-07-28 11:31:39 +00:00
|
|
|
run: |
|
2020-08-14 02:23:27 +00:00
|
|
|
pwd
|
|
|
|
ls -a ./
|
2020-08-14 04:39:02 +00:00
|
|
|
archivebox version
|
2020-07-22 23:30:36 +00:00
|
|
|
|
|
|
|
- name: Test built package with pytest
|
|
|
|
run: |
|
2020-07-28 11:27:42 +00:00
|
|
|
python -m pytest -s
|