diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..7dc0ac5 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,48 @@ +name: E2E Test + +on: + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + e2e-test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + clang_version: [16, 17, 18, 19, 20, 21] + clang_style: [LLVM, Google, Chromium, Mozilla, WebKit] + + name: Test clang ${{ matrix.clang_version }} with style ${{ matrix.clang_style }} + steps: + - name: Checkout workflow repo + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + repository: cloudwu/ltask + + - name: Set up Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: '3.13' + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pre-commit + + - name: Install pre-commit hooks and run + run: | + rm -f .pre-commit-config.yaml || true + cat > .pre-commit-config.yaml << EOF + repos: + - repo: https://github.com/cpp-linter/cpp-linter-hooks + rev: ${{ github.sha }} + hooks: + - id: clang-format + args: [--style=${{ matrix.clang_style }}, --version=${{ matrix.clang_version }}] + EOF + + pre-commit install + pre-commit run -v --all-files + continue-on-error: true diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 01775b0..b41d0f7 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,9 +2,9 @@ name: pre-commit on: push: - branches: main + branches: [main] pull_request: - branches: main + branches: [main] workflow_dispatch: jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 362b1d8..1a702b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test on: push: - branches: main + branches: [main] pull_request: - branches: main + branches: [main] workflow_dispatch: jobs: @@ -15,10 +15,10 @@ jobs: python-version: ["3.14", "3.13", "3.12", "3.11", "3.10", "3.9"] steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v5 + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v5.0.0 with: python-version: ${{ matrix.python-version }} @@ -32,7 +32,7 @@ jobs: coverage run --source=tests,cpp_linter_hooks -m pytest -vv coverage report coverage xml - - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5 + - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 #v5.0.1 if: matrix.python-version == '3.13' with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4562e09..708d486 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: check-toml - id: requirements-txt-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.13.1 + rev: v0.14.2 hooks: # Run the linter. - id: ruff-check