Merge pull request #554 from holyspectral/increase-memory-limit #1951
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| environment: ci | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Install system dependencies for eBPF build | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| libelf-dev \ | |
| clang \ | |
| llvm \ | |
| libbpf-dev | |
| - name: test kubectl plugin build for all platforms | |
| run: make kubectl-plugin-cross | |
| - run: make test | |
| - name: Upload unit-tests coverage to Codecov | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| name: unit-tests | |
| directory: coverage | |
| flags: unit-tests | |
| verbose: true | |
| helm-unittest: | |
| name: Helm unittest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0 | |
| with: | |
| version: v3.19.0 | |
| - name: Install Helm-unittest | |
| # Pin version to 1.0.2 due to https://github.com/helm-unittest/helm-unittest/issues/790 | |
| run: helm plugin install https://github.com/helm-unittest/helm-unittest --version 1.0.2 | |
| - run: make helm-unittest | |
| linter: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y \ | |
| pip \ | |
| build-essential \ | |
| libelf-dev \ | |
| clang \ | |
| llvm \ | |
| libbpf-dev | |
| pip install pre-commit | |
| - name: Cache precommit linters | |
| id: cache-precommit-linters | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: | | |
| ~/.cache/pre-commit/ | |
| key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Generate eBPF code | |
| run: make generate-ebpf | |
| - name: Run linters | |
| run: | | |
| pre-commit run --show-diff-on-failure --color=always --all-files | |
| commitlint: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| env: | |
| COMMITLINT_VERSION: "20.5.0" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Cache commitlint | |
| id: cache-commitlint | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: | | |
| node_modules | |
| package.json | |
| package-lock.json | |
| key: ${{ runner.os }}-commitlint-${{ env.COMMITLINT_VERSION }} | |
| - name: Install commitlint | |
| if: steps.cache-commitlint.outputs.cache-hit != 'true' | |
| run: npm install -D @commitlint/cli@${{ env.COMMITLINT_VERSION }} @commitlint/config-conventional@${{ env.COMMITLINT_VERSION }} | |
| - name: Print versions | |
| run: | | |
| git --version | |
| node --version | |
| npm --version | |
| npx commitlint --version | |
| - name: Validate PR commits with commitlint | |
| run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
| verify-generated-code: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| libelf-dev \ | |
| clang \ | |
| llvm \ | |
| libbpf-dev \ | |
| protobuf-compiler | |
| - name: Generate files | |
| run: make generate | |
| - name: Check working tree is clean | |
| run: | | |
| if ! git diff --quiet; then | |
| echo "generated files are not up to date. Run: make generate" | |
| echo "" | |
| echo "Diff:" | |
| git --no-pager diff | |
| exit 1 | |
| fi |