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/refactor #10

Merged
merged 11 commits into from
Aug 23, 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
27 changes: 27 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "download-built-artifact"
description: "Download the compiled artifact from the previous build job"

inputs:
os:
description: "The operating system to run the test on"
required: true
java:
description: "The java version to run the test on"
required: true
need-package:
description: "Whether to download the packaged artifact"
required: false
default: "false"

runs:
using: "composite"
steps:
- uses: actions/download-artifact@v4
with:
name: compiled-iginx-${{ inputs.os }}-${{ inputs.java }}
path: ..
- if: inputs.need-packaged
uses: actions/download-artifact@v4
with:
name: packaged-iginx-${{ inputs.os }}-${{ inputs.java }}
path: core/target/
33 changes: 33 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Test

on:
workflow_dispatch:

jobs:
build:
strategy:
fail-fast: false
matrix:
java: [ "8" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
uses: ./.github/workflows/build.yml
with:
java: ${{ matrix.java }}
os: ${{ matrix.os }}
test:
needs: build
strategy:
fail-fast: false
matrix:
java: [ "8" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
with:
os: ${{ inputs.os }}
java: ${{ inputs.java }}
need-package: true
- shell: bash
run: tree
38 changes: 16 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java }}
Expand All @@ -40,32 +38,28 @@ jobs:
- name: upload compiled files
uses: actions/upload-artifact@v4
with:
name: compiled-iginx
name: compiled-iginx-${{ inputs.os }}-${{ inputs.java }}
if-no-files-found: error
path: "*"
test:
needs: compile
runs-on: ${{ inputs.os }}
steps:
- uses: actions/download-artifact@v4
with:
name: compiled-iginx
- name: Run tests
run: |
mvn test --batch-mode -P-format
path: |
*
!.github/**
!.git/**

package:
needs: compile
runs-on: ${{ inputs.os }}
steps:
- uses: actions/download-artifact@v4
- uses: actions/checkout@v4
- uses: ./.github/actions/build
with:
name: compiled-iginx
- name: package IGinX
os: ${{ inputs.os }}
java: ${{ inputs.java }}
- shell: bash
run: |
mvn package -DskipTests -P-format -P release
- name: upload packaged files
uses: actions/upload-artifact@v4
mvn package --batch-mode -DskipTests -P-format -P release -P-thrift-generation
- uses: actions/upload-artifact@v4
with:
name: packaged-iginx
name: packaged-iginx-${{ inputs.os }}-${{ inputs.java }}
if-no-files-found: error
path: "assembly/target/iginx-assembly-*.tar.gz"
path: |
core/target/iginx-core-*/*
Loading