From 964ca0a6f1ef951d10cdfd1a24e8d76761147a46 Mon Sep 17 00:00:00 2001 From: Devon R Date: Sun, 20 Feb 2022 14:36:31 +0900 Subject: [PATCH] Add GitHub Actions non-test workflows --- .github/workflows/build.yml | 73 +++++++++++++++++++++++++++++++++++ .github/workflows/pyright.yml | 40 +++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/pyright.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..430931e0c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: build + +on: + push: + pull_request: + types: [ opened, edited ] + +jobs: + build-dists: + runs-on: ubuntu-latest + name: dists + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up CPython + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -U -r requirements.txt + + - name: Build distributions + run: | + python ./setup.py sdist bdist_wheel + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: distributions + path: dist/* + + build-docs: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + language: [ en, ja ] + name: docs (${{ matrix.language }}) + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up CPython + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + + # Install all features + pip install -e .[docs,speed,voice] + + - name: Build docs + shell: bash + run: | + cd docs && sphinx-build -b html -D language=${SPHINX_LANGUAGE} -a -n -T -W --keep-going . _build + env: + SPHINX_LANGUAGE: ${{ matrix.language }} + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + if: always() + with: + name: docs-${{matrix.language}} + path: docs/_build/* diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yml new file mode 100644 index 000000000..152ee9970 --- /dev/null +++ b/.github/workflows/pyright.yml @@ -0,0 +1,40 @@ +name: pyright + +on: + push: + pull_request: + types: [ opened, edited ] + +jobs: + check: + runs-on: ubuntu-latest + name: check + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up CPython + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install -U -r requirements.txt + + - name: Setup node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Install pyright + run: | + npm install -g pyright + + - name: Type check + run: | + # It is OK for the types to not pass at this stage + # We are just running it as a quick reference check + pyright || echo "Type checking did not pass"