chore: test github pages build

api-breakage
Morty Space 3 years ago
parent 07840c05e0
commit 9f3d3d6513
  1. 152
      .github/workflows/test_release.yml

@ -18,7 +18,7 @@ jobs:
strategy: strategy:
max-parallel: 1 max-parallel: 1
matrix: matrix:
python-version: ['3.10.7', '3.9', '3.8', '3.7'] python-version: ['3.10.7'] #, '3.9', '3.8', '3.7']
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Download code - name: Download code
@ -30,82 +30,90 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Download cache for pip # - name: Download cache for pip
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ~/.cache/pip # path: ~/.cache/pip
key: py-${{ matrix.python-version }}-poetry-pip-1.2.2 # key: py-${{ matrix.python-version }}-poetry-pip-1.2.2
restore-keys: poetry-pip # restore-keys: poetry-pip
- name: Install poetry - name: Install poetry
run: pip install poetry==1.2.2 run: pip install poetry==1.2.2
- name: Download cache for poetry # - name: Download cache for poetry
id: poetry-install # id: poetry-install
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ./.venv/ # path: ./.venv/
key: py-${{ matrix.python-version }}-poetry-install-${{ hashFiles('poetry.lock') }} # key: py-${{ matrix.python-version }}-poetry-install-${{ hashFiles('poetry.lock') }}
restore-keys: poetry-install # restore-keys: poetry-install
- name: Install packages - name: Install packages
if: steps.poetry-install.outputs.cache-hit != 'true' if: steps.poetry-install.outputs.cache-hit != 'true'
run: rm -rf ./.venv/ && poetry install run: rm -rf ./.venv/ && poetry install
- name: Download cache for pre-commit # - name: Download cache for pre-commit
if: matrix.python-version == '3.10.7' # if: matrix.python-version == '3.10.7'
id: pre-commit-install # id: pre-commit-install
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ~/.cache/pre-commit # path: ~/.cache/pre-commit
key: py-${{ matrix.python-version }}-pre-commit-install-${{ hashFiles('.pre-commit-config.yaml') }} # key: py-${{ matrix.python-version }}-pre-commit-install-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: pre-commit-install # restore-keys: pre-commit-install
- name: Verify commit # - name: Verify commit
if: matrix.python-version == '3.10.7' # if: matrix.python-version == '3.10.7'
run: poetry run pre-commit run -a # run: poetry run pre-commit run -a
- name: Auto-generate missing pairs # - name: Auto-generate missing pairs
run: . activate.sh && poetry run python generatestructs.py # run: . activate.sh && poetry run python generatestructs.py
- name: Commit & Push changes # - name: Commit & Push changes
if: matrix.python-version == '3.10.7' && github.ref == 'refs/heads/main' # if: matrix.python-version == '3.10.7' && github.ref == 'refs/heads/main'
uses: actions-js/push@v1.3 # uses: actions-js/push@v1.3
with: # with:
author_email: "morty.space@gmail.com" # author_email: "morty.space@gmail.com"
author_name: "Morty Space" # author_name: "Morty Space"
directory: './src' # directory: './src'
message: "sync: updated API pairs and coins" # message: "sync: updated API pairs and coins"
github_token: ${{ secrets.GITHUB_TOKEN }} # github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare codeclimate # - name: Prepare codeclimate
if: matrix.python-version == '3.10.7' # if: matrix.python-version == '3.10.7'
run: | # run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter # curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter # chmod +x ./cc-test-reporter
./cc-test-reporter before-build # ./cc-test-reporter before-build
- name: Test docs - name: Test docs
run: . activate.sh && cd docs && make doctest && cd .. run: . activate.sh && cd docs && make doctest && cd ..
- name: Test code - name: Running the Sphinx to gh-pages Action
timeout-minutes: 6 uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.0.0
run: . activate.sh && poetry run pytest -v --cov . --cov-report xml:coverage.xml
- name: Send codeclimate analytics
if: matrix.python-version == '3.10.7'
run: ./cc-test-reporter after-build -r ${{ secrets.CC_TEST_REPORTER_ID }} --exit-code $?
release:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Setup Python
uses: actions/setup-python@v2
with: with:
python-version: '3.10.7' branch: main
- name: Checkout code dir_docs: docs
uses: actions/checkout@v2 sphinxapiopts: '--separate -o . ../'
with: sphinxapiexclude: '../*setup* ../*.ipynb'
fetch-depth: 0 sphinxopts: ''
- name: Release # - name: Test code
env: # timeout-minutes: 6
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # run: . activate.sh && poetry run pytest -v --cov . --cov-report xml:coverage.xml
REPOSITORY_USERNAME: '__token__' # - name: Send codeclimate analytics
REPOSITORY_PASSWORD: ${{ secrets.REPOSITORY_PASSWORD }} # if: matrix.python-version == '3.10.7'
run: | # run: ./cc-test-reporter after-build -r ${{ secrets.CC_TEST_REPORTER_ID }} --exit-code $?
git fetch --all # release:
git reset --hard origin/main # runs-on: ubuntu-latest
pip install python-semantic-release # needs: test
git config user.name github-actions # if: github.ref == 'refs/heads/main'
git config user.email github-actions@github.com # steps:
semantic-release publish # - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.10.7'
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Release
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# REPOSITORY_USERNAME: '__token__'
# REPOSITORY_PASSWORD: ${{ secrets.REPOSITORY_PASSWORD }}
# run: |
# git fetch --all
# git reset --hard origin/main
# pip install python-semantic-release
# git config user.name github-actions
# git config user.email github-actions@github.com
# semantic-release publish

Loading…
Cancel
Save