From 1bdd9528d8ea41317ded28ad6c671350e9c3ff3e Mon Sep 17 00:00:00 2001 From: Utku Ozdemir Date: Tue, 30 Aug 2022 14:01:00 +0200 Subject: [PATCH] chore: add github actions workflows Add the initial CI workflows. Signed-off-by: Utku Ozdemir --- .conform.yaml | 37 ++++++++++++++++++++ .github/dependabot.yml | 19 ++++++++++ .github/workflows/ci.yml | 39 +++++++++++++++++++++ .github/workflows/codeql-analysis.yml | 50 +++++++++++++++++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 .conform.yaml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.conform.yaml b/.conform.yaml new file mode 100644 index 0000000..50efd86 --- /dev/null +++ b/.conform.yaml @@ -0,0 +1,37 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2022-08-25T08:24:11Z by kres latest. + +--- +policies: +- type: commit + spec: + dco: true + gpg: + required: true + identity: + gitHubOrganization: cosi-project + spellcheck: + locale: US + maximumOfOneCommit: true + header: + length: 89 + imperative: true + case: lower + invalidLastCharacters: . + body: + required: true + conventional: + types: ["chore","docs","perf","refactor","style","test","release"] + scopes: [".*"] +- type: license + spec: + skipPaths: + - .git/ + - testdata/ + includeSuffixes: + - .go + excludeSuffixes: + - .pb.go + - .pb.gw.go + header: "// This Source Code Form is subject to the terms of the Mozilla Public\u000A// License, v. 2.0. If a copy of the MPL was not distributed with this\u000A// file, You can obtain one at http://mozilla.org/MPL/2.0/.\u000A" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..40dc4aa --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "gomod" + directory: "/" + commit-message: + prefix: "chore:" + open-pull-requests-limit: 10 + rebase-strategy: disabled + schedule: + interval: "weekly" + day: "monday" + time: "01:00" + timezone: "UTC" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d9682f2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: ci + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3.0.2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2.0.0 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.0.0 + - + name: base + run: make base + - + name: unit-tests + run: make unit-tests + - + name: codecov + uses: codecov/codecov-action@v3.1.0 + with: + files: ./_out/coverage.txt + - + name: unit-tests-race + run: make unit-tests-race + - + name: lint + run: make lint diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..652cd88 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,50 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '26 21 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # 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. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2