Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raghu0891 committed Nov 12, 2024
0 parents commit 1591898
Show file tree
Hide file tree
Showing 35 changed files with 5,693 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
20 changes: 20 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "goplugin/plugin-feeds"
}
],
"privatePackages": {
"version": true,
"tag": true
},
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
6 changes: 6 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
self-hosted-runner:
- ubuntu20.04-4cores-16GB
- ubuntu20.04-8cores-32GB
- ubuntu20.04-16cores-64GB
- ubuntu20.04-32cores-128GB
- ubuntu20.04-64cores-256GB
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
- package-ecosystem: gomod
directory: '/'
schedule:
interval: daily
- package-ecosystem: docker
directory: '/'
schedule:
interval: daily
125 changes: 125 additions & 0 deletions .github/workflows/pull-request-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: pull-request-master

on:
merge_group:
pull_request:
branches:
- master
# Only run 1 of this workflow at a time per PR
concurrency:
group: plugin-feeds-${{ github.ref }}
cancel-in-progress: true

env:
PACKAGES: "./..."

jobs:
init:
runs-on: ubuntu-latest
outputs:
matrix_packages: ${{ steps.set-matrix-packages.outputs.matrix_packages }}
lint_args_packages: ${{ steps.set-matrix-packages.outputs.lint_args_packages }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set matrix packages
id: set-matrix-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
run: |
matrix_packages=$(echo "${PACKAGES}" | jq -R 'split(",")' | tr -d "\n\t")
echo "matrix_packages=${matrix_packages}" | tee -a "${GITHUB_OUTPUT}"
- name: Set lint args packages
id: set-lint-args-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
# Convert "producer,reports_consumer" to "./producer/... ./reports_consumer/..."
run: echo "lint_args_packages=$(echo "./$(echo $PACKAGES | sed 's/,/\/... .\//g;s/$/\/.../')")" | tee -a "${GITHUB_OUTPUT}"

ci-lint:
runs-on: ubuntu-latest
needs: [init]
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-lint
uses: goplugin/.github/actions/ci-lint-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-lint
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: true
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
golangci-lint-version: "v1.55.2"
golangci-lint-args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml

ci-lint-misc:
runs-on: ubuntu-latest
steps:
- name: ci-lint-misc
uses: goplugin/.github/actions/ci-lint-misc@6b08487b176ef7cad086526d0b54ddff6691c044 # [email protected]
with:
# grafana inputs
metrics-job-name: ci-lint-misc
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}

ci-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-test
uses: goplugin/.github/actions/ci-test-go@a15f84fcc168830a5341c7f08592eed85bb34913 # [email protected]
with:
# grafana inputs
metrics-job-name: ci-test
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# docker inputs
use-docker-compose: "true"
docker-compose-workdir: ./tools/docker/setup-postgres
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: "true"
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
go-test-cmd: make test-ci
enable-go-test-race: "true"

ci-sonarqube:
needs: [ci-lint, ci-test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: ci-sonarqube
uses: goplugin/.github/actions/ci-sonarqube-go@3e11dbc45e4c8b18dd996fb417ccf22056176388 # [email protected]
with:
# grafana inputs
metrics-job-name: ci-sonarqube
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# sonarqube inputs
include-lint: "true"
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
147 changes: 147 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: push-master

on:
push:
branches:
- master

env:
PACKAGES: "./..."

jobs:
init:
runs-on: ubuntu-latest
outputs:
matrix_packages: ${{ steps.set-matrix-packages.outputs.matrix_packages }}
lint_args_packages: ${{ steps.set-matrix-packages.outputs.lint_args_packages }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set matrix packages
id: set-matrix-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
run: |
matrix_packages=$(echo "${PACKAGES}" | jq -R 'split(",")' | tr -d "\n\t")
echo "matrix_packages=${matrix_packages}" | tee -a "${GITHUB_OUTPUT}"
- name: Set lint args packages
id: set-lint-args-packages
shell: bash
env:
PACKAGES: ${{ env.PACKAGES }}
run: echo "lint_args_packages=$(echo "./$(echo $PACKAGES | sed 's/,/\/... .\//g;s/$/\/.../')")" | tee -a "${GITHUB_OUTPUT}"

ci-lint:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-lint
uses: goplugin/.github/actions/ci-lint-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-lint
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: true
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
golangci-lint-version: "v1.55.2"
golangci-lint-args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml

ci-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: ci-test
uses: goplugin/.github/actions/ci-test-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# grafana inputs
metrics-job-name: ci-test
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# docker inputs
use-docker-compose: "true"
docker-compose-workdir: ./tools/docker/setup-postgres
# env inputs
use-env-files: "true"
env-files: ./tools/env/ci.env
# go inputs
use-go-cache: "true"
go-cache-dep-path: "**/go.sum"
go-version-file: go.mod
go-test-cmd: make test-ci

ci-sonarqube:
needs: [ci-lint, ci-test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: ci-sonarqube
uses: goplugin/.github/actions/ci-sonarqube-go@3e11dbc45e4c8b18dd996fb417ccf22056176388 # [email protected]
with:
# grafana inputs
metrics-job-name: ci-sonarqube
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
# sonarqube inputs
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}

cd-release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
changesets_published: ${{ steps.cd-release.outputs.published }}
changesets_publishedPackages: ${{ steps.cd-release.outputs.publishedPackages }}
steps:
- name: cd-release
id: cd-release
uses: goplugin/.github/actions/cicd-changesets@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
with:
# general inputs
git-user: app-token-issuer-foundations[bot]
git-email: app-token-issuer-foundations[bot]@users.noreply.github.com
pnpm-use-cache: false
# aws inputs
aws-region: ${{ secrets.AWS_REGION }}
aws-role-arn: ${{ secrets.AWS_OIDC_PLUGIN_FEEDS_CI_CHANGESET_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.AWS_FOUNDATIONS_GATI_URL }}
# grafana inputs
metrics-job-name: cd-release
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}

cicd-build-publish-artifacts-release:
# Call push-tag-release for [email protected]
name: Call push-tag-release for ${{ matrix.package.name }}@${{ matrix.package.version }}
if: needs.cd-release.outputs.changesets_published == 'true'
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.cd-release.outputs.changesets_publishedPackages) }}
permissions:
id-token: write
contents: write
actions: read
needs: [cd-release]
uses: ./.github/workflows/push-tag-release.yml
secrets: inherit
with:
tag: "${{ matrix.package.name }}@${{ matrix.package.version }}"
Loading

0 comments on commit 1591898

Please sign in to comment.