diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..696b5d7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fb037ce --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + HATCH_VERSION: "1.7.0" + PYTHON_VERSION: "3.9" + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Hatch + run: pipx install hatch==${{ env.HATCH_VERSION }} + + - name: Set up Python with pip cache + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Check Formatting (Black) + run: hatch run black datalogger_jupyterlab --check + + - name: Lint (Flake8) + run: hatch run flake8 datalogger_jupyterlab + + - name: Lint (Pylint) + run: hatch run pylint datalogger_jupyterlab + + - name: Type Check (Mypy) + run: hatch run mypy datalogger_jupyterlab diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000..a125bc9 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,70 @@ +name: Deploy to GitHub Pages + +on: workflow_dispatch + +env: + HATCH_VERSION: "1.7.0" + PYTHON_VERSION: "3.9" + JUPYTERLAB_DISPLAY_NAME_VERSION: "0.1.0" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Hatch + run: pipx install hatch==${{ env.HATCH_VERSION }} + + - name: Set up Python with pip cache + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Build package + run: hatch build + + - name: Create _site/releases/index.html + run: | + mkdir _site + mkdir _site/releases + echo ' + +
+ jupyterlab-display-name + + ' > _site/releases/index.html + + - name: Create _site/releases/jupyterlab-display-name/index.html + run: | + mkdir _site/releases/jupyterlab-display-name + echo ' + + + + jupyterlab_display_names-${{ env.JUPYTERLAB_DISPLAY_NAME_VERSION }}-py3-none-any.whl + + jupyterlab_display_names-${{ env.JUPYTERLAB_DISPLAY_NAME_VERSION }}.tar.gz + + ' > _site/releases/jupyterlab-display-name/index.html + + - name: Move package files into _site/releases/jupyterlab-display-name + run: mv dist/* _site/releases/jupyterlab-display-name + + - name: Upload site artifact + uses: actions/upload-pages-artifact@v2 + + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2