Skip to content

Commit

Permalink
CI test and publish for versions
Browse files Browse the repository at this point in the history
The github workflows have been updated to publish the v1 image as *both*
`v1` and `latest` tags for now, as well as under the jupyter alias. The
`v2` is published separately as just `v2`.
  • Loading branch information
bloodearnest committed Nov 22, 2023
1 parent 552309c commit 4e16b3b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
name: Build and publish
on:
workflow_dispatch:
push:
branches: [main]
workflow_dispatch:
permissions:
packages: write
env:
IMAGE_NAME: python
jobs:
build-and-publish:
runs-on: ubuntu-20.04
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build image
run: make build
uses: actions/checkout@master
- name: Build images
run: |
just build v1
just build v2
- name: Run tests
run: make test functional-test
- name: Run lint
run: make lint
run: |
just test v1
just test v2
- name: Run linters
run: just check

- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME"
docker tag "$IMAGE_NAME" "$IMAGE_ID:latest"
docker push "$IMAGE_ID:latest"
JUPYTER_ID="ghcr.io/${{ github.repository_owner }}/jupyter"
# also publish as jupyter image for backward compatibility
docker tag "$IMAGE_NAME" "$JUPYTER_ID:latest"
docker push "$JUPYTER_ID:latest"
just publish v1
just publish v2
21 changes: 13 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: Run tests
on:
pull_request:
env:
IMAGE_NAME: python
jobs:
tests:
runs-on: ubuntu-20.04
version-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
version: [v1, v2]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build image
run: make build
run: just build ${{ matrix.version }}
- name: Run tests
run: make test functional-test
- name: Run lint
run: make lint
run: just test ${{ matrix.version }}
lint:
runs-on: ubuntu-22.04
steps:
- name: Run linters
run: just check

0 comments on commit 4e16b3b

Please sign in to comment.