Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-tingaikin authored Sep 7, 2023
0 parents commit 17d45e3
Show file tree
Hide file tree
Showing 23 changed files with 865 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/automerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: automerge
on:
workflow_run:
types:
- completed
workflows:
- "ci"
jobs:
print-debug-info:
name: Print debug info
runs-on: ubuntu-latest
steps:
- uses: hmarr/debug-action@v2

check-mergeability:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.actor == 'nsmbot' }}
uses: networkservicemesh/.github/.github/workflows/check-mergeability.yaml@main
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}

automerge:
needs: [check-mergeability]
if: ${{ needs.check-mergeability.result == 'success' }}
uses: networkservicemesh/.github/.github/workflows/automerge.yaml@main
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}

resolve_conflicts:
needs: [check-mergeability]
if: ${{ always() && needs.check-mergeability.result == 'failure' && needs.check-mergeability.outputs.pr_branch_ref != '' }}
uses: networkservicemesh/.github/.github/workflows/resolve-conflicts.yaml@main
with:
pr_branch_ref: ${{ needs.check-mergeability.outputs.pr_branch_ref }}
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: ci
on:
push:
branches:
- 'main'
- 'release/**'
pull_request:
jobs:
yamllint:
uses: networkservicemesh/.github/.github/workflows/yamllint.yaml@main
with:
config_file: "./.yamllint.yml"

shellcheck:
uses: networkservicemesh/.github/.github/workflows/shellcheck.yaml@main

golangci-lint:
uses: networkservicemesh/.github/.github/workflows/golangci-lint.yaml@main

excludeFmtErrorf:
uses: networkservicemesh/.github/.github/workflows/exclude-fmt-errorf.yaml@main

restrictNSMDeps:
uses: networkservicemesh/.github/.github/workflows/restrict-nsm-deps.yaml@main
with:
allowed_repositories: "api, sdk, sdk-k8s, sdk-kernel, sdk-sriov, sdk-vpp, govpp, vpphelper"

checkgomod:
uses: networkservicemesh/.github/.github/workflows/checkgomod.yaml@main

gogenerate:
uses: networkservicemesh/.github/.github/workflows/cmd-gogenerate.yaml@main

excludereplace:
uses: networkservicemesh/.github/.github/workflows/exclude-replace.yaml@main

docker-build-and-test:
if: github.repository != 'networkservicemesh/cmd-template'
uses: networkservicemesh/.github/.github/workflows/docker-build-and-test.yaml@main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 5 * * 0'

jobs:
analyze:
uses: networkservicemesh/.github/.github/workflows/codeql-analysis.yaml@main
10 changes: 10 additions & 0 deletions .github/workflows/docker-push-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Docker push ghcr

on:
push:
branches: [main]
jobs:
push:
if: ${{ github.repository != 'networkservicemesh/cmd-template' && (github.event.workflow_run.conclusion == 'success' && github.actor == 'nsmbot' || github.event_name == 'push') }}
uses: networkservicemesh/.github/.github/workflows/docker-push-ghcr.yaml@main
13 changes: 13 additions & 0 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Docker push
on:
push:
branches:
- main
jobs:
push:
if: ${{ github.repository != 'networkservicemesh/cmd-template' && (github.event.workflow_run.conclusion == 'success' && github.actor == 'nsmbot' || github.event_name == 'push') }}
uses: networkservicemesh/.github/.github/workflows/docker-push.yaml@main
secrets:
docker-login: ${{ secrets.DOCKER_LOGIN }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
11 changes: 11 additions & 0 deletions .github/workflows/pr-for-updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Pull Request on update/* Branch Push
on:
push:
branches:
- update/**
jobs:
auto-pull-request:
uses: networkservicemesh/.github/.github/workflows/pr-for-updates.yaml@main
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Release

on:
workflow_run:
types:
- completed
workflows:
- "ci"
jobs:
get-tag:
name: Get tag
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }}
outputs:
tag: ${{ steps.get-tag-step.outputs.tag }}
steps:
- name: Get tag
run: |
branch=${{github.event.workflow_run.head_branch}}
echo tag=${branch#release/} >> $GITHUB_OUTPUT
id: get-tag-step

check-gomod-deps:
needs: get-tag
uses: networkservicemesh/.github/.github/workflows/check-gomod-deps.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}

create-release:
needs: [get-tag, check-gomod-deps]
uses: networkservicemesh/.github/.github/workflows/release.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}

docker:
needs: [get-tag, check-gomod-deps]
uses: networkservicemesh/.github/.github/workflows/docker-release.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

check-branch:
name: Check release branch in deployments-k8s
needs: [get-tag, create-release]
uses: networkservicemesh/.github/.github/workflows/check-release-branch.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}

update-deployments-k8s:
name: Update deployments-k8s
needs: [get-tag, check-branch]
if: ${{ github.repository != 'networkservicemesh/cmd-template' }}
uses: networkservicemesh/.github/.github/workflows/release-deployments.yaml@main
with:
tag: ${{ needs.get-tag.outputs.tag }}
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/update-cmd-repositories.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Update dependent repositories
on:
push:
branches:
- main

jobs:
fetch-repositories:
name: Fetch organization repositories
runs-on: ubuntu-latest
outputs:
repositories: ${{ steps.organization-repositories.outputs.repositories }}
steps:
- name: Run `get-organization-repositories`
id: organization-repositories
uses: denis-tingajkin/[email protected]
with:
github-organization: 'networkservicemesh'
regex: 'cmd-.*'
update-dependent-repositories:
strategy:
matrix:
repository: ${{ fromJSON(needs.fetch-repositories.outputs.repositories) }}
needs: fetch-repositories
name: Update ${{ matrix.repository }}
runs-on: ubuntu-latest
if: github.repository == 'networkservicemesh/cmd-template'
steps:
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@v2
with:
path: ${{ matrix.repository }}
repository: ${{ matrix.repository}}
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
- name: Sync config files
if: matrix.repository != 'networkservicemesh/cmd-template'
uses: denis-tingajkin/[email protected]
with:
git-author-email: '[email protected]'
git-author-name: 'NSMBot'
sync-branch-name: main
sync-repository: ${{ github.repository }}
sync-ignore-file-name: .templateignore
result-branch-name: update/${{ github.repository }}
working-directory: ${{ matrix.repository }}
allow-files-pattern: (.*\.yaml|.*\.yml|.*\.txt|.*\.md|.*\.conf)
exclude-files: |
.github/workflows/update-cmd-repositories.yaml
.golangci.yml
17 changes: 17 additions & 0 deletions .github/workflows/update-deployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Update deployments-k8s repository
on:
push:
branches:
- main
workflow_run:
types:
- completed
workflows:
- 'automerge'
jobs:
update-deployments-k8s:
if: ${{ github.repository != 'networkservicemesh/cmd-template' && (github.event.workflow_run.conclusion == 'success' && github.actor == 'nsmbot' || github.event_name == 'push') }}
uses: networkservicemesh/.github/.github/workflows/update-deployments.yaml@main
secrets:
token: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

.idea/
junit/
Loading

0 comments on commit 17d45e3

Please sign in to comment.