Skip to content

Commit

Permalink
改进CI配置
Browse files Browse the repository at this point in the history
  • Loading branch information
SourLemonJuice committed Jun 25, 2024
1 parent 3044d60 commit a126eca
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,27 @@ on:
env:
CI_HOST_INFO: GitHub Build Workflow

defaults:
run:
working-directory: ./source/

jobs:
build:
Unit-Testing:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./source/

steps:
- uses: actions/checkout@v4
- name: Build with make in Linux(Ubuntu)
run: make i18nglish.out build_host_description="${CI_HOST_INFO} ID:${GITHUB_RUN_ID} for ${GITHUB_REF}" "${{ inputs.make_build_arg1 }}"
- name: End test(script)
run: ./full_test.sh
- name: Build unit test
run: make test
- name: Unit testing
run: ./test.out

Build-for-Linux:
runs-on: ubuntu-latest
needs: [Unit-Testing]
steps:
- uses: actions/checkout@v4
- name: Build with make in Linux(Ubuntu)
run: make i18nglish.out build_host_description="${{ env.CI_HOST_INFO }} ID:${{ github.run_id }} for ${{ github.ref }}" "${{ inputs.make_build_arg1 }}"
- name: Upload executable file
uses: actions/upload-artifact@v4
with:
Expand All @@ -40,14 +44,26 @@ jobs:
if-no-files-found: error
retention-days: 7

End-to-End-Testing:
runs-on: ubuntu-latest
needs: [Unit-Testing, Build-for-Linux]
steps:
- uses: actions/checkout@v4
- name: Download artifact(Linux)
uses: actions/download-artifact@v4
with:
name: i18nglish-Linux(.out)
- name: End to End test(script)
run: ./full_test.sh

# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
# https://www.msys2.org/docs/ci/
build-for-windows:
Build-for-Windows:
runs-on: windows-latest
needs: [Unit-Testing, End-to-End-Testing, Build-for-Linux]
defaults:
run:
shell: msys2 {0}
working-directory: ./source/
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
Expand All @@ -56,11 +72,7 @@ jobs:
update: true
install: make git mingw-w64-ucrt-x86_64-clang
- name: Build with make in Windows(MSYS2)
run: make i18nglish.exe build_host_description="${CI_HOST_INFO} ID:${GITHUB_RUN_ID} for ${GITHUB_REF}" "${{ inputs.make_build_arg1 }}"
- name: Build unit test
run: make test
- name: Unit testing
run: ./test.out
run: make i18nglish.exe build_host_description="${{ env.CI_HOST_INFO }} ID:${{ github.run_id }} for ${{ github.ref }}" "${{ inputs.make_build_arg1 }}"
- name: Upload executable file(.exe)
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit a126eca

Please sign in to comment.