Skip to content

Commit

Permalink
Improve CI (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh1isper authored Dec 29, 2023
1 parent 634e2a0 commit 3254904
Show file tree
Hide file tree
Showing 27 changed files with 186 additions and 480 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dev/
dist/
docker/
.github/
47 changes: 47 additions & 0 deletions .github/workflows/build-latest-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build latest images automatically

on:
push:
branches:
- main

jobs:
deploy:
strategy:
fail-fast: true

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Build docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push latest jupyterlab-sparglim image
id: docker_build_jupyterlab_sparglim_latest
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile.jupyterlab-sparglim
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jupyterlab-sparglim:latest
-
name: Build and push latest sparglim-server image
id: docker_build_sparglim_server_latest
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile.sparglim-server
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sparglim-server:latest
59 changes: 0 additions & 59 deletions .github/workflows/build_images.yml

This file was deleted.

90 changes: 0 additions & 90 deletions .github/workflows/build_latest_images.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Testing docker image build

on:
pull_request:
branches: ["master", "main"]

jobs:
deploy:
strategy:
fail-fast: true

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Build docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Testing build jupyterlab-sparglim image
id: docker_build_jupyterlab_sparglim
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
file: ./docker/Dockerfile.jupyterlab-sparglim
push: false
tags: jupyterlab-sparglim:latest
-
name: Testing build sparglim-server image
id: docker_build_sparglim_server
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
file: ./docker/Dockerfile.sparglim-server
push: false
tags: sparglim-server:latest
57 changes: 57 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release docker image

on:
workflow_dispatch: {}
release:
types: [published]

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Self versioning
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Versioning package
run: hatch version ${{ github.ref_name }}
# Publish
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push tagged jupyterlab-sparglim image
id: docker_build_jupyterlab_sparglim
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile.jupyterlab-sparglim
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jupyterlab-sparglim:${{ github.ref_name }}
-
name: Build and push tagged sparglim-server image
id: docker_build_sparglim_server
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64/v8
file: ./docker/Dockerfile.sparglim-server
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sparglim-server:${{ github.ref_name }}
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Versioning package
run: hatch version ${{ github.ref_name }}
- name: Build package
run: python -m build
- name: Publish package
Expand All @@ -37,3 +39,9 @@ jobs:
file_glob: true
tag: ${{ github.ref }}
overwrite: true
- name: Bump to next micro dev version
run: hatch version micro && hatch version dev
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Bump to next micro version
branch: ${{ github.event.repository.default_branch }}
12 changes: 7 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
- name: Test with pytype
continue-on-error: true
run: |
pytype ./sparglim
- name: Test with pytest
run: |
pytest -vv
- name: Install dependencies for building
run: |
pip install build twine hatch
- name: Test building
run: python -m build
17 changes: 0 additions & 17 deletions dev/docker/Dockerfile.jupyterlab-sparglim

This file was deleted.

10 changes: 0 additions & 10 deletions dev/docker/Dockerfile.sparglim-server

This file was deleted.

14 changes: 0 additions & 14 deletions dev/jupyter-sparglim-on-k8s/README.md

This file was deleted.

Loading

0 comments on commit 3254904

Please sign in to comment.