diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index fd47f7a..8152c0f 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -1,5 +1,5 @@ -name: "javascript-action CodeQL config" +name: javascript-action CodeQL config -paths-ignore: +paths-ignore: - node_modules - dist diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 3c56766..51100ea 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -5,15 +5,15 @@ # We need to make sure the checked-in `index.js` actually matches what we expect it to be. name: Check dist/ -on: +on: # yamllint disable-line rule:truthy push: branches: - main paths-ignore: - - '**.md' + - "**.md" pull_request: paths-ignore: - - '**.md' + - "**.md" workflow_dispatch: jobs: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4237b53..f9c7391 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,16 +9,16 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL" +name: CodeQL -on: +on: # yamllint disable-line rule:truthy push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - - cron: '24 5 * * 6' + - cron: 24 5 * * 6 jobs: analyze: @@ -32,40 +32,40 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: [javascript] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - config-file: ./.github/codeql/codeql-config.yml - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + config-file: ./.github/codeql/codeql-config.yml + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + # - run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 5a8f08b..527b9a8 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -1,8 +1,8 @@ name: Scheduled build -on: +on: # yamllint disable-line rule:truthy schedule: - - cron: "30 8 * * *" + - cron: 30 8 * * * jobs: test: - uses: ./.github/workflows/test.yml \ No newline at end of file + uses: ./.github/workflows/test.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 98ac521..6ff90cb 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,10 +1,12 @@ name: Pull request -on: +on: # yamllint disable-line rule:truthy pull_request: banches: - main jobs: + yamllint: + uses: ./.github/workflows/yamllint.yml test: uses: ./.github/workflows/test.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b21f41d..ee81cab 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,5 +1,5 @@ name: Push -on: +on: # yamllint disable-line rule:truthy push: branches: - main diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c9eecbc..604c705 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,11 +1,11 @@ name: Release -on: +on: # yamllint disable-line rule:truthy workflow_dispatch: # Inputs the workflow accepts. inputs: tag: - description: "Tag name, e.g. 0.0.0" - default: "" + description: Tag name, e.g. 0.0.0 + default: required: true jobs: @@ -15,7 +15,6 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - name: Checkout code uses: actions/checkout@v4 @@ -57,9 +56,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: "v${{ github.event.inputs.tag }}" - release_name: "v${{github.event.inputs.tag}}" + tag_name: v${{ github.event.inputs.tag }} + release_name: v${{github.event.inputs.tag}} body: ${{ steps.changelog.outputs.changelog }} draft: false prerelease: false - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec90bb5..bbaa128 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ -name: "units-test" -on: +name: units-test +on: # yamllint disable-line rule:truthy workflow_call: jobs: @@ -7,9 +7,8 @@ jobs: units: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - run: npm ci - # - run: npm test + - uses: actions/checkout@v4 + - run: npm ci # test action works running from the graph test_ebpf: @@ -18,27 +17,27 @@ jobs: matrix: ebpf_provider: [libbpf] steps: - - name: Install mlocate - run: sudo apt-get install -y mlocate - - uses: actions/checkout@v4 - - uses: ./ - with: - ebpfprovider: ${{matrix.ebpf_provider}} - - name: verify - run: | - ./verify.sh ${{matrix.ebpf_provider}} + - name: Install mlocate + run: sudo apt-get install -y mlocate + - uses: actions/checkout@v4 + - uses: ./ + with: + ebpfprovider: ${{matrix.ebpf_provider}} + - name: verify + run: | + ./verify.sh ${{matrix.ebpf_provider}} test_xgboost: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - xgboost_version: 2.0.1 - artifact_version: 0.26.0 - - name: verify - run: | - ./verify.sh xgboost + - uses: actions/checkout@v4 + - uses: ./ + with: + xgboost_version: 2.0.1 + artifact_version: 0.26.0 + - name: verify + run: | + ./verify.sh xgboost # test action works running from the graph test_local_cluster: @@ -47,65 +46,64 @@ jobs: fail-fast: false matrix: include: - - cluster_provider: kind - prometheus_operator_version: v0.12.0 - PROMETHEUS_ENABLE: false - GRAFANA_ENABLE: false - TEKTON_ENABLE: false - test_name: kind_basic - - cluster_provider: kind - prometheus_operator_version: v0.12.0 - PROMETHEUS_ENABLE: true - GRAFANA_ENABLE: true - TEKTON_ENABLE: true - test_name: kind_with_prometheus_and_tekton + - cluster_provider: kind + prometheus_operator_version: v0.12.0 + PROMETHEUS_ENABLE: false + GRAFANA_ENABLE: false + TEKTON_ENABLE: false + test_name: kind_basic + - cluster_provider: kind + prometheus_operator_version: v0.12.0 + PROMETHEUS_ENABLE: true + GRAFANA_ENABLE: true + TEKTON_ENABLE: true + test_name: kind_with_prometheus_and_tekton steps: - - uses: actions/checkout@v4 - - uses: ./ - name: ${{matrix.test_name}} - with: - ebpfprovider: ${{matrix.ebpf_provider}} - cluster_provider: ${{matrix.cluster_provider}} - prometheus_enable: ${{matrix.PROMETHEUS_ENABLE}} - prometheus_operator_version: v0.12.0 - grafana_enable: ${{matrix.GRAFANA_ENABLE}} - tekton_enable: ${{matrix.TEKTON_ENABLE}} - - name: verify - run: | - ./verify.sh cluster + - uses: actions/checkout@v4 + - uses: ./ + name: ${{matrix.test_name}} + with: + ebpfprovider: ${{matrix.ebpf_provider}} + cluster_provider: ${{matrix.cluster_provider}} + prometheus_enable: ${{matrix.PROMETHEUS_ENABLE}} + prometheus_operator_version: v0.12.0 + grafana_enable: ${{matrix.GRAFANA_ENABLE}} + tekton_enable: ${{matrix.TEKTON_ENABLE}} + - name: verify + run: | + ./verify.sh cluster test_existing_cluster: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - # set up k8s cluster - - uses: ./ - name: dummy cluster for test - with: - cluster_provider: kind - config_cluster: false - # config cluster - - uses: ./ - name: config cluster - with: - cluster_provider: existing - prometheus_enable: true - tekton_enable: true - - name: verify - run: | - ./verify.sh cluster - + - uses: actions/checkout@v4 + # set up k8s cluster + - uses: ./ + name: dummy cluster for test + with: + cluster_provider: kind + config_cluster: false + # config cluster + - uses: ./ + name: config cluster + with: + cluster_provider: existing + prometheus_enable: true + tekton_enable: true + - name: verify + run: | + ./verify.sh cluster # test if kernel module can be loaded, this is very os and instance specific, ignore if it fails test_kernel_module: runs-on: ubuntu-latest env: - KERNEL_MODULE_NAMES: "rapl,intel_rapl_common,intel_rapl_msr" + KERNEL_MODULE_NAMES: rapl,intel_rapl_common,intel_rapl_msr steps: - - uses: actions/checkout@v4 - - uses: ./ - with: - kernel_module_names: ${{ env.KERNEL_MODULE_NAMES }}} - - name: verify - run: | - ./verify.sh modprobe ${{ env.KERNEL_MODULE_NAMES }} + - uses: actions/checkout@v4 + - uses: ./ + with: + kernel_module_names: ${{ env.KERNEL_MODULE_NAMES }}} + - name: verify + run: | + ./verify.sh modprobe ${{ env.KERNEL_MODULE_NAMES }} diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml new file mode 100644 index 0000000..701e522 --- /dev/null +++ b/.github/workflows/yamllint.yml @@ -0,0 +1,12 @@ +name: yamllint + +on: # yamllint disable-line rule:truthy + workflow_call: + +jobs: + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: yamllint + run: yamllint -c .yamllint.yaml --strict . diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..52e718d --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,16 @@ +--- +extends: default +rules: + line-length: disable + document-start: disable + comments: + min-spaces-from-content: 1 + quoted-strings: + required: only-when-needed + extra-required: + - ^.*:\s.*$ + - ^.*:$ + quote-type: double +ignore: + - _output/* + - vendor/* diff --git a/action.yml b/action.yml index c0dcd7e..af31d1c 100644 --- a/action.yml +++ b/action.yml @@ -1,18 +1,60 @@ -name: 'kepler github action for set up cluster' -description: 'kepler github action for set up cluster' +name: kepler github action for set up cluster +description: kepler github action for set up cluster inputs: - runningBranch: # id of input - description: 'runningBranch for kepler CI' + runningBranch: # id of input + description: runningBranch for kepler CI required: false ebpfprovider: - description: 'ebpf provider for kepler CI' + description: ebpf provider for kepler CI required: false cluster_provider: - description: 'k8s cluster provider for kepler CI' + description: k8s cluster provider for kepler CI required: false kernel_module_names: - description: 'comma delimited kernel module names to install for kepler CI, e.g. rapl,intel_rapl_msr' + description: comma delimited kernel module names to install for kepler CI, e.g. rapl,intel_rapl_msr + required: false + prometheus_enable: + description: enable prometheus for kepler CI + required: false + prometheus_operator_version: + description: prometheus operator version for kepler CI + required: false + grafana_enable: + description: enable grafana for kepler CI + required: false + tekton_enable: + description: enable tekton for kepler CI + required: false + kind_version: + description: kind version for kepler CI + required: false + kubectl_version: + description: kubectl version for kepler CI + required: false + local_path: + description: local path for kepler CI + required: false + local_dev_cluster_version: + description: local dev cluster version for kepler CI + required: false + artifacts_version: + description: artifacts version for kepler CI + required: false + xgboost_version: + description: xgboost version for kepler CI + required: false + libbpf_version: + description: libbpf version for kepler CI + required: false + install_containerruntime: + description: install container runtime for kepler CI + required: false + restartcontianerruntime: + description: restart container runtime for kepler CI + required: false + config_cluster: + description: config cluster for kepler CI required: false runs: - using: 'node20' - main: 'dist/index.js' + using: node20 + main: dist/index.js