Skip to content

Commit

Permalink
Merge pull request #2118 from PrincetonUniversity/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
kmantel authored Sep 17, 2021
2 parents cf381ac + 42ee1c8 commit 912f691
Show file tree
Hide file tree
Showing 16 changed files with 214 additions and 180 deletions.
54 changes: 54 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '{build}'
branches:
except:
- gh-pages
skip_tags: true
skip_branch_with_pr: true
clone_depth: 15
image: Ubuntu2004
environment:
PIP_PROGRESS_BAR: off
APPVEYOR_CONSOLE_DISABLE_PTY: true
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
matrix:
- PYTHON: python3.8

init:
- ps: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential graphviz git curl $Env:PYTHON-dev $Env:PYTHON-distutils $Env:PYTHON-venv
sudo update-alternatives --install /usr/bin/python python /usr/bin/$Env:PYTHON 10
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/$Env:PYTHON 10
sudo update-alternatives --set python /usr/bin/$Env:PYTHON
sudo update-alternatives --set python3 /usr/bin/$Env:PYTHON
install:
- ps: |
python -m venv venv
venv/bin/Activate.ps1
echo "#!/bin/sh" > venv/bin/xdg-open
chmod +x venv/bin/xdg-open
pip --version
pip install -U pip wheel cython
pip install -U coveralls
pip install -U -e .[dev]
build: off

test_script:
- ps: |
if (Test-Path Env:\COVERALLS_REPO_TOKEN ) {
$Env:COV="--cov=psyneulink"
}
python -m pytest --junit-xml=tests_out.xml $Env:COV --verbosity=0 --capture=sys -o console_output_style=count
on_success:
- ps: |
if (Test-Path Env:\COVERALLS_REPO_TOKEN ) {
coveralls
}
on_finish:
- ps: curl -X POST -F "file=@tests_out.xml" https://ci.appveyor.com/api/testresults/junit/$Env:APPVEYOR_JOB_ID
19 changes: 12 additions & 7 deletions .github/workflows/compare-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: 'Download docs artifacts'
id: docs-artifacts
uses: actions/github-script@v4.0.2
uses: actions/github-script@v4.1
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
Expand All @@ -32,11 +32,14 @@ jobs:
core.setOutput('DOCS_GEN_ENV', docsSuffix);
var docsArtifacts = artifacts.data.artifacts.filter((artifact) => {
return artifact.name.endsWith(docsSuffix) && artifact.name.startsWith('Documentation-')
return (
(artifact.name.endsWith(docsSuffix) && artifact.name.startsWith('Documentation-'))
|| artifact.name == 'pr_number'
)
});
// check that we got exactly 2 artifacts
console.assert(docsArtifacts.length == 2, docsSuffix, docsArtifacts, artifacts.data.artifacts);
// check that we got exactly 3 artifacts
console.assert(docsArtifacts.length == 3, docsSuffix, docsArtifacts, artifacts.data.artifacts);
var fs = require('fs');
for (artifact of docsArtifacts) {
Expand All @@ -55,6 +58,7 @@ jobs:
run: |
unzip Documentation-base-*.zip -d docs-base/
unzip Documentation-head-*.zip -d docs-head/
unzip pr_number.zip
- name: Compare
shell: bash
Expand All @@ -64,16 +68,17 @@ jobs:
(diff -r docs-base docs-head && echo 'No differences!' || true) | tee ./result.diff
- name: Post comment with docs diff
uses: actions/github-script@v4.0.2
uses: actions/github-script@v4.1
with:
script: |
var fs = require('fs');
var text = fs.readFileSync("./result.diff").slice(0,16384);
var issue_number = Number(fs.readFileSync('./pr_number.txt'));
console.log('Posting diff to PR: ${{ github.event.workflow_run.pull_requests[0].number }}')
console.log('Posting diff to PR: ' + issue_number);
github.issues.createComment({
issue_number: ${{ github.event.workflow_run.pull_requests[0].number }},
issue_number: issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This PR causes the following changes to the html docs (${{ steps.docs-artifacts.outputs.DOCS_GEN_ENV }}):\n```\n' + text + '\n...\n```\nSee CI logs for the full diff.'
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/pnl-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,26 @@ jobs:
run: git tag 'v999.999.999.999'

- name: Build Documentation
run: sphinx-build -b html -aE -j auto docs/source pnl-html
run: make -C docs/ html -e SPHINXOPTS="-aE -j auto"

- name: Upload Documentation
uses: actions/[email protected]
with:
name: Documentation-${{matrix.pnl-version}}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
retention-days: 1
path: pnl-html
path: docs/build/html

- name: Store PR number
if: ${{ github.event_name == 'pull_request' }}
run: echo ${{ github.event.pull_request.number }} > ./pr_number.txt

- name: Upload PR number for other workflows
if: ${{ github.event_name == 'pull_request' }}
uses: actions/[email protected]
with:
name: pr_number
path: ./pr_number.txt


docs-deploy:
strategy:
Expand Down
120 changes: 0 additions & 120 deletions .github/workflows/pnl-docs-compare.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
branch: master

- name: Check for existing release with the reference tag
uses: actions/github-script@v4
uses: actions/github-script@v4.1
id: exist_check
with:
script: |
Expand All @@ -47,7 +47,7 @@ jobs:
}
- name: Create Release
uses: actions/github-script@v4
uses: actions/github-script@v4.1
if: steps.on_master.outputs.on-branch == 'master' && steps.exist_check.outputs.exists == 'no'
with:
# We need custom token since the default one doesn't trigger actions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
TWINE_REPOSITORY: ${{ secrets.TWINE_REPOSITORY }}

- name: Upload dist files to release
uses: actions/github-script@v4
uses: actions/github-script@v4.1
with:
script: |
const fs = require('fs')
Expand Down
4 changes: 2 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def get_func_execution(func, func_mode):
elif func_mode == 'Python':
return func.function
else:
assert False, "Unknown function mode: {}".format(mode)
assert False, "Unknown function mode: {}".format(mech_mode)

@pytest.helpers.register
def get_mech_execution(mech, mech_mode):
Expand All @@ -132,7 +132,7 @@ def mech_wrapper(x):
return mech.output_values
return mech_wrapper
else:
assert False, "Unknown mechanism mode: {}".format(mode)
assert False, "Unknown mechanism mode: {}".format(mech_mode)

@pytest.helpers.register
def expand_np_ndarray(arr):
Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupyter<=1.0.0
pytest<6.2.5
pytest<6.2.6
pytest-benchmark<3.4.2
pytest-cov<2.12.2
pytest-helpers-namespace<2021.4.30
Expand Down
Loading

0 comments on commit 912f691

Please sign in to comment.