Skip to content

Commit

Permalink
Merge pull request #130 from dave-tucker/yamllint
Browse files Browse the repository at this point in the history
Lint all YAML and Fix actions.yml
  • Loading branch information
SamYuan1990 authored Jul 10, 2024
2 parents d2da1e4 + 131527c commit b5d7c0c
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 131 deletions.
4 changes: 2 additions & 2 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "javascript-action CodeQL config"
name: javascript-action CodeQL config

paths-ignore:
paths-ignore:
- node_modules
- dist
6 changes: 3 additions & 3 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
64 changes: 32 additions & 32 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -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
uses: ./.github/workflows/test.yml
4 changes: 3 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Push
on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -15,7 +15,6 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v4

Expand Down Expand Up @@ -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

144 changes: 71 additions & 73 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: "units-test"
on:
name: units-test
on: # yamllint disable-line rule:truthy
workflow_call:

jobs:
# unit tests
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:
Expand All @@ -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:
Expand All @@ -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 }}
12 changes: 12 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -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 .
16 changes: 16 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -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/*
Loading

0 comments on commit b5d7c0c

Please sign in to comment.