Skip to content

Commit

Permalink
Prep for 1.0, fix up readme and godoc (#1)
Browse files Browse the repository at this point in the history
and add workflows
  • Loading branch information
ldemailly authored Feb 19, 2023
1 parent b0faa83 commit 3e5d606
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
76 changes: 76 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

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

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' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# 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#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Go Reference](https://pkg.go.dev/badge/fortio.org/scli.svg)](https://pkg.go.dev/fortio.org/scli)
[![Go Report Card](https://goreportcard.com/badge/fortio.org/scli)](https://goreportcard.com/report/fortio.org/scli)
[![GitHub Release](https://img.shields.io/github/release/fortio/scli.svg?style=flat)](https://github.com/fortio/scli/releases/)
# scli

Extends [cli](https://github.com/fortio/cli#cli) to server `main()`s .
Expand Down
8 changes: 4 additions & 4 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// [ServerMain] allows the setup of a confimap/directory watch for flags
// and a config endpoint (uses [fortio.org/dflag]).
// Configure using the [cli] package variables (at minimum [MinArgs] unless your
// binary only accepts flags), setup additional [flag]s before calling
// binary only accepts flags), setup additional [flag] before calling
// [ServerMain].
package scli // import "fortio.org/scli"

Expand All @@ -23,9 +23,9 @@ import (
)

// ServerMain extends [cli.Main] and returns true if a config port server has been started
// caller needs to select {} after its own code is ready.
// Will have called ExitFunction (ie exited) if there are usage errors
// (wrong number of arguments, bad flags etc...).
// caller needs to select {} after their own code is ready.
// [cli.ExitFunction] will have been called (ie program will have exited exited)
// if there are usage errors (wrong number of arguments, bad flags etc...).
// It sets up (optional) config-dir to watch and listen on config-port for dynamic flag
// changes and UI/api.
func ServerMain() bool {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module fortio.org/scli
go 1.18

require (
fortio.org/cli v0.6.2
fortio.org/dflag v1.4.1
fortio.org/cli v1.0.0
fortio.org/dflag v1.4.2
fortio.org/fortio v1.50.1
fortio.org/log v1.2.2
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fortio.org/assert v1.1.3 h1:zXm8xiNiKvq2xG/YQ3sONAg3287XUuklKIDdjyD9pyg=
fortio.org/cli v0.6.2 h1:WY/22DFh8z+qEzZXNKfHsHu5JsJhQbmnlMQSot21ifA=
fortio.org/cli v0.6.2/go.mod h1:O3nVImKwJSvHKbMYWkqMbEagAXCS1xvSv1YbHwkKJjY=
fortio.org/dflag v1.4.1 h1:WDhlHMh3yrQFrvspyN5YEyr8WATdKM2dUJlTxsjCDtI=
fortio.org/dflag v1.4.1/go.mod h1:pTEF7UEj6sHP9rj9gZG2GyhAGrrPJE4c6zOO7zB2yyI=
fortio.org/cli v1.0.0 h1:qUyHr1DiyxFoq5RBPFJ6Hw30NcV/0KYSxmptdiLiW5I=
fortio.org/cli v1.0.0/go.mod h1:O3nVImKwJSvHKbMYWkqMbEagAXCS1xvSv1YbHwkKJjY=
fortio.org/dflag v1.4.2 h1:kkPNgmoGViSqh16Muf3BGt+qxPgsx+yfFGB/bpmiGqM=
fortio.org/dflag v1.4.2/go.mod h1:pTEF7UEj6sHP9rj9gZG2GyhAGrrPJE4c6zOO7zB2yyI=
fortio.org/fortio v1.50.1 h1:5FSttAHQsyAsi3dzxDmSByfzDYByrWY/yw53bqOg+Kc=
fortio.org/fortio v1.50.1/go.mod h1:TpAo6nixVbTxeIfE8F2c63D3ffouMTa+KDr9eFAYxys=
fortio.org/log v1.2.2 h1:vs42JjNwiqbMbacittZjJE9+oi72Za6aekML9gKmILg=
Expand Down

0 comments on commit 3e5d606

Please sign in to comment.