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

build: update workflow and change to the new ARM64 runner #168

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
78 changes: 3 additions & 75 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,86 +126,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# copy from https://github.com/Cyan4973/xxHash/blob/dev/.github/workflows/ci.yml
# Linux ARM64
# All tests are using QEMU and gcc cross compiler.

qemu-consistency:
name: QEMU ${{ matrix.name }}
needs: Linux
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true # 'false' means Don't stop matrix workflows even if some matrix failed.
matrix:
include: [
{ name: 'ARM64', xcc_pkg: gcc-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-latest, },

{ name: 'ARM64, gcc-9', xcc_pkg: gcc-9-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc-9, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static, os: ubuntu-20.04, },
]
env: # Set environment variables
CC: ${{ matrix.xcc }}
XEMU: ${{ matrix.xemu }}
# LDFLAGS: -static
steps:
- uses: actions/checkout@v2 # https://github.com/actions/checkout
- name: apt update & install (1)
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib qemu-utils qemu-user-static
- name: Environment info (1)
run: |
echo && apt-cache search "^gcc-" | grep "linux" | sort
- name: apt update & install (2)
run: |
sudo apt-get install ${{ matrix.xcc_pkg }} ${{ matrix.xemu_pkg }}
- name: Environment info (2)
run: |
echo && which $CC
echo && $CC --version
echo && $CC -v # Show built-in specs
echo && which $XEMU
echo && $XEMU --version
- name: ARM64
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
cmakeBuildType: 'Release'
buildDirectory: "${{ github.workspace }}/build"
buildWithCMake: true
buildWithCMakeArgs: --config Release
# cmakeAppendedArgs: " -DCODE_COVERAGE=OFF -DBUILD_SHELL=OFF -DBUILD_TEST_EXAMPLE=OFF -DBUILD_STATIC"
cmakeAppendedArgs: " -DCODE_COVERAGE=OFF -DBUILD_SHELL=OFF -DBUILD_TEST_EXAMPLE=OFF"
- name: "Check file existence"
uses: andstor/file-existence-action@v1
with:
allow_failure: true
# files: "${{ github.workspace }}/build/src/libsimple.a, ${{ github.workspace }}/build/src/libPINYIN_TEXT.a, ${{ github.workspace }}/build/test/dict/jieba.dict.utf8"
files: "${{ github.workspace }}/build/src/libsimple.so, ${{ github.workspace }}/build/test/dict/jieba.dict.utf8"
- name: Package
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir libsimple-${{ matrix.xcc }}
# cp -r src/libsimple.a src/libPINYIN_TEXT.a test/dict/ libsimple-linux-${{ matrix.xcc }}/
cp -r src/libsimple.so test/dict/ libsimple-${{ matrix.xcc }}/
zip -r libsimple-${{ matrix.xcc }}.zip libsimple-${{ matrix.xcc }}
working-directory: "${{ github.workspace }}/build"
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
draft: true
files: ${{ github.workspace }}/build/libsimple-${{ matrix.xcc }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-22.04-arm
- os: ubuntu-latest
steps:
- name: "Release Build Type"
Expand Down Expand Up @@ -261,10 +189,10 @@ jobs:
# CODE COVERAGE
- name: Code coverage - Capture coverage info
if: ${{ startsWith(github.ref, 'refs/tags/') != true && matrix.os == 'ubuntu-latest' }}
run: lcov --directory . --capture --output-file coverage.info
run: lcov --directory . --capture --output-file coverage.info --ignore-errors mismatch
- name: Code coverage - Filter out system, external, and unit test source files
if: ${{ startsWith(github.ref, 'refs/tags/') != true && matrix.os == 'ubuntu-latest' }}
run: lcov --remove coverage.info --output-file coverage_filter.info '/Library/*' '/usr/*' '*/test/*' '*/cmrc/*' '*/entry.cc' '*/simple_highlight.*'
run: lcov --remove coverage.info --output-file coverage_filter.info '/Library/*' '/usr/*' '*/test/*' '*/cmrc/*' '*/entry.cc' '*/simple_highlight.*' --ignore-errors unused
- name: Code coverage - Output coverage data for debugging
if: ${{ startsWith(github.ref, 'refs/tags/') != true && matrix.os == 'ubuntu-latest' }}
run: lcov --list coverage_filter.info
Expand Down
Loading