82 lines
2.3 KiB
YAML
82 lines
2.3 KiB
YAML
name: 'Test'
|
|
on: [push]
|
|
|
|
jobs:
|
|
pytest:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
python: [3.7, 3.8]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 1
|
|
|
|
### Setup Python & JS Languages
|
|
- name: Set up Python ${{ matrix.python }}
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
architecture: x64
|
|
|
|
- name: Set up Node JS 14.7.0
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14.7.0
|
|
|
|
### Install Python & JS Dependencies
|
|
- name: Get pip cache dir
|
|
id: pip-cache
|
|
run: |
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
- name: Cache pip
|
|
uses: actions/cache@v2
|
|
id: cache-pip
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('setup.py') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.python }}-venv-
|
|
|
|
- name: Install pip dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip setuptools wheel pytest bottle
|
|
./bin/build_pip.sh
|
|
python -m pip install .
|
|
|
|
- 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
|
|
with:
|
|
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
|
|
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
|
|
|
|
### Run the tests
|
|
- name: Directory listing for debugging
|
|
run: |
|
|
pwd
|
|
ls -a ./
|
|
archivebox version
|
|
|
|
- name: Test built package with pytest
|
|
run: |
|
|
python -m pytest -s
|