Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: adjust token and build by action #837

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions .github/workflows/build-dev-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build dev image
name: Build dev image on push to main automatically

on:
push:
Expand All @@ -24,28 +24,39 @@ jobs:
- name: Build
run: |
./mvnw clean install -B -DskipTests -P exec-jar
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/canner/wren-engine
tags: |
type=sha
type=raw,value=nightly
- name: Login to ghcr
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
- name: Prepare
id: prepare
run: |
cp ./wren-server/target/wren-server-${WREN_VERSION}-executable.jar ./docker
WREN_VERSION=$(./mvnw --quiet help:evaluate -Dexpression=project.version -DforceStdout)
LATEST_COMMIT=$(git log -1 --pretty=%h)
cd ./docker
cp ../wren-server/target/wren-server-${WREN_VERSION}-executable.jar ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/canner/wren-engine:main-${LATEST_COMMIT} \
--tag ghcr.io/canner/wren-engine:nightly \
--push -f ./Dockerfile \
--build-arg "WREN_VERSION=${WREN_VERSION}" .
echo "WREN_VERSION=$WREN_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./docker
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
build-args: |
WREN_VERSION=${{ steps.prepare.outputs.WREN_VERSION }}
push: true
build-ibis-image:
runs-on: ubuntu-latest
steps:
Expand Down
36 changes: 23 additions & 13 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build image
name: Build image manually

on:
workflow_dispatch:
Expand Down Expand Up @@ -37,28 +37,38 @@ jobs:
- name: Build
run: |
./mvnw clean install -B -DskipTests -P exec-jar
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/canner/wren-engine
tags: |
type=raw,value=${{ needs.prepare-tag.outputs.tag_name }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
env:
TAG_NAME: ${{ needs.prepare-tag.outputs.tag_name }}
- name: Prepare
id: prepare
run: |
cp ./wren-server/target/wren-server-${WREN_VERSION}-executable.jar ./docker
WREN_VERSION=$(./mvnw --quiet help:evaluate -Dexpression=project.version -DforceStdout)
cd ./docker
cp ../wren-server/target/wren-server-${WREN_VERSION}-executable.jar ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/canner/wren-engine:$TAG_NAME \
--push -f ./Dockerfile \
--build-arg "WREN_VERSION=${WREN_VERSION}" .
echo "WREN_VERSION=$WREN_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./docker
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
build-args: |
WREN_VERSION=${{ steps.prepare.outputs.WREN_VERSION }}
push: true
build-ibis-image:
needs: prepare-tag
runs-on: ubuntu-latest
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/build.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/deploy.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Run secret-dependent integration tests
name: Integration tests
name: Maven tests

on:
pull_request:
Expand All @@ -16,26 +15,23 @@ concurrency:
cancel-in-progress: true

jobs:
# Branch-based in origin repo pull request
integration-trusted:
maven-tests:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.label.name == 'v1-engine-changed' }}
if: ${{ github.event.label.name == 'v1-engine-changed' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
- name: build
run: |
./mvnw clean install -B -DskipTests
- name: unit tests
run: |
./mvnw test -B --fail-at-end -pl !:wren-tests
- name: integration tests
env:
TEST_BIG_QUERY_PROJECT_ID: ${{ secrets.TEST_BIG_QUERY_PROJECT_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/modeling-py-mult-platform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# maturin generate-ci --pytest github
#
name: Modeling Python CI
name: Modeling Python CI (multi-platform)

# We don't ready to run this workflow on stable release flow yet
on:
Expand Down
34 changes: 23 additions & 11 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,39 @@ jobs:
- name: Build
run: |
./mvnw clean install -B -DskipTests -P exec-jar
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/canner/wren-engine
tags: |
type=raw,value=${{ needs.prepare-version.outputs.maven_version }}
type=raw,value=latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
- name: Prepare
id: prepare
run: |
cp ./wren-server/target/wren-server-${WREN_VERSION}-executable.jar ./docker
WREN_VERSION=$(./mvnw --quiet help:evaluate -Dexpression=project.version -DforceStdout)
cd ./docker
cp ../wren-server/target/wren-server-${WREN_VERSION}-executable.jar ./
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/canner/wren-engine:${{ needs.prepare-version.outputs.maven_version }} \
--tag ghcr.io/canner/wren-engine:latest \
--push -f ./Dockerfile \
--build-arg "WREN_VERSION=${WREN_VERSION}" .
echo "WREN_VERSION=$WREN_VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./docker
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
build-args: |
WREN_VERSION=${{ steps.prepare.outputs.WREN_VERSION }}
push: true
stable-release-ibis:
needs: prepare-version
runs-on: ubuntu-latest
Expand Down
Loading