Skip to content

docs(api): 添加API参考和IO模块详细文档 #8

docs(api): 添加API参考和IO模块详细文档

docs(api): 添加API参考和IO模块详细文档 #8

Workflow file for this run

# .github/workflows/ci.yml

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 155, Col: 17): Unexpected symbol: ','. Located at position 18 within expression: matrix.build_type,,, (Line: 156, Col: 17): Unexpected symbol: ','. Located at position 18 within expression: matrix.build_type,,
name: FastQTools CI/CD Pipeline
on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]
env:
CONAN_VERSION: 2.19.0
jobs:
lint:
name: Code Quality and Linting
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cache Conan
uses: actions/cache@v3
with:
path: ~/.conan2
key: ${{ runner.os }}-conan-${{ hashFiles('config/dependencies/**') }}
restore-keys: ${{ runner.os }}-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: ~/.cache/ccache
key: ${{ runner.os }}-ccache-lint-${{ github.sha }}
restore-keys: ${{ runner.os }}-ccache-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
# cache configured above
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential wget clang-19 clang-tidy-19 clang-format-19 ninja-build ccache
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 100
- name: Install Conan
run: |
pip install conan==${{ env.CONAN_VERSION }}
conan profile detect --force
- name: Build project for code analysis
run: |
./scripts/build.sh clang Release
- name: Run linting script
run: |
./scripts/lint.sh --build-dir build-clang-release
- name: Install Node.js for commitlint
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install and run commitlint
run: |
npm install -g @commitlint/cli @commitlint/config-conventional
commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Generate clang-tidy report
run: |
clang-tidy -p build-clang-release src/**/*.cpp src/**/*.h -export-fixes=clang-tidy-fixes.yml || true
- name: Upload clang-tidy report
uses: actions/upload-artifact@v3
with:
name: clang-tidy-report
path: clang-tidy-fixes.yml
retention-days: 7
build-and-test:
name: ${{ matrix.os }} / ${{ matrix.compiler.name }} / ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler:
- { name: gcc, cc: gcc, cxx: g++ }
- { name: clang, cc: clang, cxx: clang++ }
build_type: [Debug, Release]
exclude:
# Exclude some combinations to reduce CI time
- compiler: gcc
build_type: Debug
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cache Conan
uses: actions/cache@v3
with:
path: ~/.conan2
key: ${{ runner.os }}-conan-${{ hashFiles('config/dependencies/**') }}
restore-keys: ${{ runner.os }}-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: ~/.cache/ccache
key: ${{ runner.os }}-ccache-${{ matrix.compiler.name }}-${{ matrix.build_type }}-${{ github.ref }}
restore-keys: ${{ runner.os }}-ccache-
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential wget ninja-build ccache
- name: Install Clang/LLVM
if: matrix.compiler.name == 'clang'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
sudo apt-get install -y clang-19 clang-tidy-19 clang-format-19 lld-19
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
- name: Set up Python for Conan
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Conan
run: |
pip install conan==${{ env.CONAN_VERSION }}
conan profile detect --force
- name: Build via script
run: |
./scripts/build.sh ${{ matrix.compiler.name }} ${{ matrix.build_type }}
- name: Run tests via script
if: matrix.build_type == 'Release'
run: |
./scripts/test.sh -c ${{ matrix.compiler.name }} -t ${{ matrix.build_type }} -j 2
- name: Upload build artifacts
if: matrix.build_type == 'Release'
uses: actions/upload-artifact@v3
with:
name: fastqtools-${{ matrix.compiler.name }}-${{ matrix.build_type,, }}
path: build-${{ matrix.compiler.name }}-${{ matrix.build_type,, }}/FastQTools
retention-days: 7
docker-build:
name: Docker Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: |
docker build -f docker/Dockerfile -t fastqtools:latest .
- name: Build development Docker image
run: |
docker build -f docker/Dockerfile.dev -t fastqtools:dev .
- name: Test Docker image
run: |
docker run --rm fastqtools:latest --help
- name: Test development Docker image
run: |
docker run --rm fastqtools:dev --help
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cache Conan
uses: actions/cache@v3
with:
path: ~/.conan2
key: ${{ runner.os }}-conan-${{ hashFiles('config/dependencies/**') }}
restore-keys: ${{ runner.os }}-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: ~/.cache/ccache
key: ${{ runner.os }}-ccache-coverage-${{ github.sha }}
restore-keys: ${{ runner.os }}-ccache-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y lcov ninja-build ccache wget clang-19 clang-tidy-19 clang-format-19 llvm-19 lld-19
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 100
- name: Set up Python for Conan
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Conan
run: |
pip install conan==${{ env.CONAN_VERSION }}
conan profile detect --force
- name: Run coverage
run: |
./scripts/test.sh -c clang -t Coverage -C -j 2
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
with:
name: coverage
path: build-clang-coverage/coverage/coverage-filtered.info
retention-days: 7