From 4e16b3bb9c909ae6bf94c3250cecefd219234f44 Mon Sep 17 00:00:00 2001 From: bloodearnest Date: Wed, 22 Nov 2023 17:20:42 +0000 Subject: [PATCH] CI test and publish for versions 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`. --- .github/workflows/build_and_publish.yaml | 37 ++++++++++-------------- .github/workflows/tests.yaml | 21 +++++++++----- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index 84349d8..02b0da0 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -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 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b449bd5..0ae8359 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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 +