Skip to content

Commit

Permalink
Add GitHub actions and dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhad6 committed Oct 31, 2023
1 parent c592ee5 commit 16ea182
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
70 changes: 70 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -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 '<!DOCTYPE html>
<html>
<body>
<a href="jupyterlab-display-name/">jupyterlab-display-name</a>
</body>
</html>' > _site/releases/index.html
- name: Create _site/releases/jupyterlab-display-name/index.html
run: |
mkdir _site/releases/jupyterlab-display-name
echo '<!DOCTYPE html>
<html>
<body>
<a href="jupyterlab_display_names-${{ env.JUPYTERLAB_DISPLAY_NAME_VERSION }}-py3-none-any.whl">
jupyterlab_display_names-${{ env.JUPYTERLAB_DISPLAY_NAME_VERSION }}-py3-none-any.whl
</a>
<a href="jupyterlab_display_names-${{ env.JUPYTERLAB_DISPLAY_NAME_VERSION }}.tar.gz">jupyterlab_display_names-${{ env.JUPYTERLAB_DISPLAY_NAME_VERSION }}.tar.gz</a>
</body>
</html>' > _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

0 comments on commit 16ea182

Please sign in to comment.