diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b38c74a..2de9c39 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,9 +9,42 @@ on: workflow_dispatch: jobs: helm: - uses: parcelLab/ci/.github/workflows/helm.yaml@v9 - with: - chartsPath: parcellab + runs-on: ubuntu-latest + timeout-minutes: 40 + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Helm + uses: azure/setup-helm@v5 + + - name: Lint and render charts + run: | + set -euo pipefail + charts=() + while IFS= read -r chart; do + parent=$(dirname "$chart") + # A chart in /charts/ is a vendored dependency. It is validated + # through its parent, which supplies its values. + if [ "$(basename "$parent")" = charts ] && [ -f "$(dirname "$parent")/Chart.yaml" ]; then + continue + fi + charts+=("$chart") + done < <(find parcellab -name Chart.yaml -exec dirname {} \; | sort) + if [ ${#charts[@]} -eq 0 ]; then + echo "::error::No Chart.yaml found under parcellab" + exit 1 + fi + for chart in "${charts[@]}"; do + echo "::group::$chart" + helm dependency build "$chart" + helm lint "$chart" + # Library charts render nothing and make `helm template` fail. + if ! helm show chart "$chart" | grep -q "^type: library"; then + helm template "$chart" > /dev/null + fi + echo "::endgroup::" + done # Required status check in branch protection (INF-4419). Fails if any # check failed or was cancelled. diff --git a/.github/workflows/json.yaml b/.github/workflows/json.yaml index cb90b94..9b4c2d0 100644 --- a/.github/workflows/json.yaml +++ b/.github/workflows/json.yaml @@ -11,4 +11,14 @@ on: workflow_dispatch: jobs: lint: - uses: parcelLab/ci/.github/workflows/json.yaml@v9 + runs-on: ubuntu-latest + timeout-minutes: 40 + steps: + - name: Checkout + uses: actions/checkout@v7 + - name: Set up node environment + uses: actions/setup-node@v7 + with: + node-version: lts/* + - name: Lint JSON + run: npx --yes prettier@3.9.6 --check -- "**/*.json" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 62d0654..b354787 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -8,7 +8,31 @@ on: - reopened - synchronize jobs: - pr: - uses: parcelLab/ci/.github/workflows/pr.yaml@v9 - secrets: - repoAccessToken: ${{ secrets.GITHUB_TOKEN }} + label: + runs-on: ubuntu-latest + timeout-minutes: 40 + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v7 + - name: Label PR based on pushed file paths + continue-on-error: true + uses: actions/labeler@v7.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler.yaml + sync-labels: true + + validate_title: + name: Validate PR title + runs-on: ubuntu-latest + timeout-minutes: 40 + steps: + - uses: amannn/action-semantic-pull-request@v6.1.1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + requireScope: false + validateSingleCommit: false diff --git a/.github/workflows/yaml.yaml b/.github/workflows/yaml.yaml index 3bee924..0c44897 100644 --- a/.github/workflows/yaml.yaml +++ b/.github/workflows/yaml.yaml @@ -13,4 +13,14 @@ on: workflow_dispatch: jobs: lint: - uses: parcelLab/ci/.github/workflows/yaml.yaml@v9 + runs-on: ubuntu-latest + timeout-minutes: 40 + steps: + - name: Checkout + uses: actions/checkout@v7 + - name: Set up node environment + uses: actions/setup-node@v7 + with: + node-version: lts/* + - name: Lint YAML files + run: npx --yes prettier@3.9.6 --check -- "**/*.{yaml,yml}"