Repository: tobin-wainer/elk (language: python)

Issue:
Create GitHub actions for automated testing and JOSS paper creation
@TomWagg knows what to do

By my estimate this is the final thing to do before the initial PyPi release


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/joss_compile.yml b/.github/workflows/joss_compile.yml
new file mode 100644
index 0000000..5d55d9b
--- /dev/null
+++ b/.github/workflows/joss_compile.yml
@@ -0,0 +1,27 @@
+name: Compile JOSS paper
+
+on:
+  push:
+    branches: [ joss ]
+      paths:
+        - 'paper.md'
+        - 'paper.bib'
+  workflow_dispatch:
+
+jobs:
+  paper:
+    runs-on: ubuntu-latest
+    name: Paper Draft
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+      - name: Build draft PDF
+        uses: openjournals/openjournals-draft-action@master
+        with:
+          journal: joss
+          paper-path: paper.md
+      - name: Upload
+        uses: actions/upload-artifact@v1
+        with:
+          name: paper
+          path: paper.pdf
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/perform_tests.yml b/.github/workflows/perform_tests.yml
new file mode 100644
index 0000000..49cdd4b
--- /dev/null
+++ b/.github/workflows/perform_tests.yml
@@ -0,0 +1,53 @@
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Run all `elk` tests
+
+on:
+  push:
+    branches: [ main ]
+    paths:
+      - 'elk/**'
+      - 'requirements.txt'
+      - 'setup.cfg'
+      - 'setup.py'
+      - 'pyproject.toml'
+    
+  pull_request:
+    branches: [ main ]
+    paths:
+      - 'elk/**'
+      - 'requirements.txt'
+      - 'setup.cfg'
+      - 'setup.py'
+      - 'pyproject.toml'
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.7]
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        python -m pip install flake8 pytest coverage pytest-xdist nbmake pytest-cov
+        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+        python -m pip install .
+    - name: Lint with flake8
+      run: |
+        # stop the build if there are Python syntax errors or undefined names
+        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+    - name: Test with pytest and generate coverage report
+      run: |
+        pytest elk
\ No newline at end of file