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

Refactor workflow again #13

Merged
merged 9 commits into from
Jan 10, 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
7 changes: 4 additions & 3 deletions .github/actions/docker-buildx-push/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Docker build"
description: "Builds the Docker image."
name: "Docker buildx and push"
description: "Buildx and push the Docker image."

inputs:
ghcr-token:
Expand Down Expand Up @@ -36,6 +36,7 @@ runs:
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }}
halohub/${{ inputs.image-name }}
tags: |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}},enabled=${{ github.event_name == 'schedule' }}
type=ref,event=branch,enabled=${{ github.event_name == 'push' }}
Expand All @@ -50,7 +51,7 @@ runs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
uses: docker/login-action@v3
if: inputs.ghcr-token != '' && github.event_name != 'pull_request'
with:
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
${{ runner.os }}-pnpm-store-

- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "temurin"
cache: "gradle"
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/halo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Halo CI
name: Halo Workflow

on:
pull_request:
Expand All @@ -21,23 +21,25 @@ on:

jobs:
test:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - name: Setup Environment
# uses: ./.github/actions/setup-env
# - name: Check Halo console
# run: make -C console check
# - name: Check Halo core
# run: ./gradlew check
# - name: Analyze code
# if: ${{ github.event_name == 'push' && env.SONAR_TOKEN != '' }} # Due to inability to access secrets during PR, only the code pushed into the branch can be analyzed.
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./gradlew sonar --info
- name: Setup Environment
uses: ./.github/actions/setup-env
- name: Check Halo console
run: make -C console check
- name: Check Halo core
run: ./gradlew check
- name: Analyze code
if: ${{ github.event_name == 'push' && env.SONAR_TOKEN != '' }} # Due to inability to access secrets during PR, only the code pushed into the branch can be analyzed.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar --info
build:
runs-on: ubuntu-latest
if: always() && (needs.test.result == 'skipped' || needs.test.result == 'success')
needs: test
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -94,13 +96,13 @@ jobs:
with:
image-name: ${{ github.event_name == 'release' && 'halo' || 'halo-dev' }}
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
# dockerhub-user: ${{ secrets.DOCKER_USERNAME }}
# dockerhub-token: ${{ secrets.DOCKER_TOKEN }}
dockerhub-user: ${{ secrets.DOCKER_USERNAME }}
dockerhub-token: ${{ secrets.DOCKER_TOKEN }}
push: true
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x

e2e-test:
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
needs: build
steps:
Expand Down
Loading