<commit_before>name: test

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

on:
  workflow_dispatch:
  push:
    branches:
      - 'master'
      - '[0-9]+.[0-9]{2}'
    tags:
      - 'v*'
  pull_request:

env:
  GO_VERSION: 1.19.1
  GOTESTLIST_VERSION: v0.2.0
  ITG_CLI_MATRIX_SIZE: 6
  BUILDX: docker buildx
  USE_BUILDX: 1
  DOCKER_EXPERIMENTAL: 1
  DOCKER_GRAPHDRIVER: overlay2

jobs:
  build-dev:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        mode:
          - ""
          - systemd
    steps:
      -
        name: Prepare
        run: |
          if [ "${{ matrix.mode }}" = "systemd" ]; then
            echo "SYSTEMD=true" >> $GITHUB_ENV
          fi
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      -
        name: Build dev image
        uses: docker/bake-action@v2
        with:
          targets: dev
          set: |
            *.cache-from=type=gha,scope=dev${{ matrix.mode }}
            *.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
            *.output=type=cacheonly

  validate:
    runs-on: ubuntu-20.04
    needs:
      - build-dev
    strategy:
      fail-fast: true
      matrix:
        script:
          - dco
          - default-seccomp
          - pkg-imports
          - yamllint
          - swagger
          - swagger-gen
          - toml
          - changelog-well-formed
          - changelog-date-descending
          - golangci-lint
          - shfmt
          - vendor
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
        with:<commit_msg>ci(test): dynamic validate matrix<commit_after>name: test

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

on:
  workflow_dispatch:
  push:
    branches:
      - 'master'
      - '[0-9]+.[0-9]{2}'
    tags:
      - 'v*'
  pull_request:

env:
  GO_VERSION: 1.19.1
  GOTESTLIST_VERSION: v0.2.0
  ITG_CLI_MATRIX_SIZE: 6
  BUILDX: docker buildx
  USE_BUILDX: 1
  DOCKER_EXPERIMENTAL: 1
  DOCKER_GRAPHDRIVER: overlay2

jobs:
  build-dev:
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        mode:
          - ""
          - systemd
    steps:
      -
        name: Prepare
        run: |
          if [ "${{ matrix.mode }}" = "systemd" ]; then
            echo "SYSTEMD=true" >> $GITHUB_ENV
          fi
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      -
        name: Build dev image
        uses: docker/bake-action@v2
        with:
          targets: dev
          set: |
            *.cache-from=type=gha,scope=dev${{ matrix.mode }}
            *.cache-to=type=gha,scope=dev${{ matrix.mode }},mode=max
            *.output=type=cacheonly

  validate-prepare:
    runs-on: ubuntu-20.04
    needs:
      - validate-dco
    outputs:
      matrix: ${{ steps.scripts.outputs.matrix }}
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Create matrix
        id: scripts
        run: |
          scripts=$(jq -ncR '[inputs]' <<< "$(ls -I .validate -I all -I default -I dco -I golangci-lint.yml -I yamllint.yaml -A ./hack/validate/)")
          echo "::set-output name=matrix::$scripts"
      -
        name: Show matrix
        run: |
          echo ${{ steps.scripts.outputs.matrix }}

  validate:
    runs-on: ubuntu-20.04
    needs:
      - validate-prepare
      - build-dev
    strategy:
      fail-fast: true
      matrix:
        script: ${{ fromJson(needs.validate-prepare.outputs.matrix) }}
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
        with:
{'fraction_non_alphanumeric': 0.1227106227106227, 'fraction_numerical': 0.01596023024594453, 'mean_word_length': 1.5796221322537112, 'pattern_counts': {'":': 1, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3680290', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1304, 'n_words': 258}