Skip to content

Commit

Permalink
Merge branch 'master' into new_vector
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBF committed May 20, 2022
2 parents aa58872 + 2bc3d1d commit c1783f7
Show file tree
Hide file tree
Showing 512 changed files with 32,630 additions and 45,349 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ defaults:

jobs:
build:
if: ${{ false && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }}
if: ${{(github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Cache files
uses: actions/cache@v2
Expand All @@ -25,6 +28,11 @@ jobs:
**/target
key: ${{ runner.os }}-${{ hashFiles('**/package.json', '**/Cargo.toml') }}

- name: Versions
run: |
npm -v
node -v
- name: Install python build dependencies
run: python3 -m pip install setuptools wheel

Expand All @@ -43,6 +51,32 @@ jobs:
- name: Check that no files are overwritten
run: git diff --exit-code

test:
if: ${{(github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./chart/chart

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Install esbuild
run: cd javascript && npm i esbuild

- name: Install testing requirements
run: pip install -r requirements_tests.txt

- name: Build
run: make javascript/dist/sseq_chart_node.js

- name: Test
run: pytest tests python/tests

clean:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-latest
Expand Down
121 changes: 98 additions & 23 deletions .github/workflows/ext.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ jobs:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}
CARGO_TARGET_DIR: /home/runner/.cargo/target

strategy:
matrix:
toolchain: ["nightly", "beta"]
toolchain: ["stable", "beta", "nightly"]

continue-on-error: ${{ matrix.toolchain == 'nightly' }}
continue-on-error: ${{ matrix.toolchain != 'stable' }}
steps:
- uses: actions/checkout@v2

Expand All @@ -31,26 +30,24 @@ jobs:
path: |
~/.cargo
/usr/share/rust/.cargo
**/target
key: test-${{ steps.rustup.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.*') }}

- name: Run sseq_gui tests
run: make -C web_ext/sseq_gui test

- name: Run sseq_gui examples
run: make -C web_ext/sseq_gui run_examples

- name: Run ext tests
run: make -C ext test

- name: Run ext examples
run: make -C ext benchmarks

- name: Run ext examples (nassau)
run: make -C ext benchmarks-nassau

- name: Run ext examples (concurrent)
run: make -C ext benchmarks-concurrent

- name: Benchmark executable size
run: |
ls -l $HOME/.cargo/target/debug/examples | grep -v ' .*-\|\.d$'
ls -l ext/target/debug/examples | grep -v ' .*-\|\.d$'
miri:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }}
Expand All @@ -59,7 +56,6 @@ jobs:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings -A stable-features"
RUSTUP_TOOLCHAIN: nightly
CARGO_TARGET_DIR: /home/runner/.cargo/target

steps:
- uses: actions/checkout@v2
Expand All @@ -77,6 +73,7 @@ jobs:
path: |
~/.cargo
/usr/share/rust/.cargo
**/target
key: miri-${{ steps.rustup.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.*') }}

- name: Run miri
Expand All @@ -92,9 +89,9 @@ jobs:

strategy:
matrix:
toolchain: ["nightly", "beta"]
toolchain: ["stable", "beta", "nightly"]

continue-on-error: ${{ matrix.toolchain == 'nightly' }}
continue-on-error: ${{ matrix.toolchain != 'stable' }}
steps:
- uses: actions/checkout@v2

Expand All @@ -105,6 +102,10 @@ jobs:
toolchain: ${{ matrix.toolchain }}
components: clippy, rustfmt

# Install black from pip3 to ensure latest version
- name: Install python dependencies
run: sudo apt-get install flake8 && pip3 install black

- name: Cache files
uses: actions/cache@v2
with:
Expand All @@ -120,6 +121,9 @@ jobs:
- name: Lint sseq_gui
run: make -C web_ext/sseq_gui lint

- name: Lint sseq_gui tests
run: make -C web_ext/sseq_gui lint-selenium

webserver:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-20.04
Expand All @@ -130,9 +134,9 @@ jobs:

strategy:
matrix:
toolchain: ["nightly", "beta"]
toolchain: ["stable", "beta", "nightly"]

continue-on-error: ${{ matrix.toolchain == 'nightly' }}
continue-on-error: ${{ matrix.toolchain != 'stable' }}
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -174,6 +178,77 @@ jobs:
name: webserver-${{ matrix.toolchain }}
path: web_ext/sseq_gui/dist/

selenium:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-20.04
timeout-minutes: 10
needs: [webserver]
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}

strategy:
matrix:
toolchain: ["stable", "beta", "nightly"]

defaults:
run:
working-directory: web_ext/sseq_gui


continue-on-error: ${{ matrix.toolchain != 'stable' }}
steps:
- uses: actions/checkout@v2

- name: Download webserver
uses: actions/download-artifact@v2
with:
name: webserver-beta
path: web_ext/sseq_gui/dist/

- name: Install rustup
uses: actions-rs/toolchain@v1
id: rustup
with:
toolchain: ${{ matrix.toolchain }}

- name: Install dependencies
run: sudo apt-get install --no-install-recommends python3-pytest python3-selenium

- name: Cache files
uses: actions/cache@v2
with:
path: |
~/.cargo
/usr/share/rust/.cargo
**/target
key: webserver-${{ steps.rustup.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.*') }}

- name: Test wasm
run: |
make serve-wasm &
(sleep 1 && make selenium)
- name: Test local
run: |
cargo build &&
(target/debug/sseq_gui &
(sleep 1 && make selenium))
- name: Test local concurrent
run: |
cargo build --features concurrent &&
(target/debug/sseq_gui &
(sleep 1 && make selenium))
- name: Upload Artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: svg-changes-${{ matrix.toolchain }}
path: web_ext/sseq_gui/tests/benchmarks/*-new.svg

calculator:
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-20.04
Expand All @@ -184,9 +259,9 @@ jobs:

strategy:
matrix:
toolchain: ["nightly", "beta"]
toolchain: ["stable", "beta", "nightly"]

continue-on-error: ${{ matrix.toolchain == 'nightly' }}
continue-on-error: ${{ matrix.toolchain != 'stable' }}
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -238,9 +313,9 @@ jobs:

strategy:
matrix:
toolchain: ["nightly", "beta"]
toolchain: ["stable", "beta", "nightly"]

continue-on-error: ${{ matrix.toolchain == 'nightly' }}
continue-on-error: ${{ matrix.toolchain != 'stable' }}
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -269,26 +344,26 @@ jobs:
path: ext/target/doc/

deploy:
needs: [test, lint, webserver, calculator, docs]
needs: [test, lint, webserver, calculator, docs, selenium]
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}

steps:
- name: Download webserver
uses: actions/download-artifact@v2
with:
name: webserver-beta
name: webserver-stable

- name: Download calculator
uses: actions/download-artifact@v2
with:
name: calculator-beta
name: calculator-stable
path: calculator

- name: Download docs
uses: actions/download-artifact@v2
with:
name: docs-beta
name: docs-stable
path: docs

- name: Deploy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
"target_url": "${{ github.event.workflow_run.html_url }}"
}' \
--fail
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
**/*.rs.bk
**/*.lock

**/dist/


# Probably need these back in ext.
# Maybe should include target & dist in repo?
Expand Down
76 changes: 76 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
files: ^chart/
default_language_version:
python: "3.9"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.1.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: "5.10.1"
hooks:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: "v2.31.0"
hooks:
- id: pyupgrade
args: ["--py39-plus"]

- repo: https://github.com/hadialqattan/pycln
rev: "v1.2.0"
hooks:
- id: pycln
args: [--config=pyproject.toml]
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.5.1"
hooks:
- id: prettier
exclude: .frag$

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.9.0"
hooks:
- id: python-check-blanket-noqa
# - id: python-check-blanket-type-ignore
- id: python-no-log-warn
- id: python-no-eval
- id: python-use-type-annotations
# - id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.8.0.4"
hooks:
- id: shellcheck

- repo: https://github.com/codespell-project/codespell
rev: "v2.1.0"
hooks:
- id: codespell
args: ["-L", "crate"]
# - repo: https://github.com/psf/black
# rev: "22.1.0"
# hooks:
# - id: black
# - repo: https://gitlab.com/pycqa/flake8
# rev: "4.0.1"
# hooks:
# - id: flake8
# additional_dependencies: [flake8-bugbear]
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: "v0.931"
# hooks:
# - id: mypy
Loading

0 comments on commit c1783f7

Please sign in to comment.