Files
LCUI/.github/workflows/ccpp.yml
T
2023-04-01 22:34:36 +08:00

140 lines
3.4 KiB
YAML

name: C/C++ CI
on: [push, pull_request]
jobs:
ubuntu_build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
runs-on: ${{ matrix.os }}
name: "Builds binaries on ${{ matrix.os }}"
steps:
- uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@v1
- name: install tools
run: sudo apt install debhelper lcov valgrind -yy
- name: Update git submodule
run: |
git submodule update --init
- name: Build
run: |
xmake config -m coverage -y -v
xmake -v
- name: Run tests
run: |
xmake run run-tests --memcheck
- name: "Run tests yutil"
run: |
xmake build yutil_test
xmake run yutil_test --memcheck
- name: Upload reports to Codecov
run: bash <(curl -s https://codecov.io/bash);
- name: Package
run: |
xmake clean
xmake config -m release -y -c -v
xmake -v
xmake package
- uses: actions/upload-artifact@master
with:
name: ubuntu-pacakges
path: |
build/packages
windows_build:
strategy:
fail-fast: false
matrix:
os: ['windows-2016']
include:
- os: 'windows-2016'
triplet: 'x64-windows'
runs-on: ${{ matrix.os }}
name: "Builds binaries on ${{ matrix.os }}"
steps:
- uses: actions/checkout@master
- uses: xmake-io/github-action-setup-xmake@v1
- name: Update git submodule
run: |
git submodule update --init
- name: Build
run: |
xmake config -y -v --ci-env=y
xmake -v
- name: "Run tests"
run: |
xmake run run-tests
- name: "Run tests yutil"
run: |
xmake build yutil_test
xmake run yutil_test
- name: Package
run: |
xmake -v
xmake package
- uses: actions/upload-artifact@master
with:
name: ubuntu-pacakges
path: |
build/packages
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [ubuntu_build, windows_build]
env:
ARTIFACT_DIR: ./release
steps:
- uses: actions/checkout@v1
- name: Download artifacts [build-ubuntu]
uses: actions/download-artifact@master
with:
name: ubuntu-packages
path: ${{ env.ARTIFACT_DIR }}
- name: Download artifacts [build-windows]
uses: actions/download-artifact@master
with:
name: windows-packages
path: ${{ env.ARTIFACT_DIR }}
- name: Set release version
run: python ./.github/scripts/get_release_version.py
- name: Create release notes
run: python ./.github/scripts/get_release_notes.py
- name: Read package.json
id: release_notes
uses: juliangruber/read-file-action@v1
with:
path: RELEASE_NOTES.md
trim: false
- name: Create release
uses: svenstaro/upload-release-action@v2
with:
body: ${{ steps.release_notes.outputs.content }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: LCUI ${{ env.REL_VERSION }}
tag: ${{ github.ref }}
file: ${{ env.ARTIFACT_DIR }}/*
overwrite: true
file_glob: true