Skip to content

Commit

Permalink
Merge pull request #7 from spiegel-im-spiegel/fix-bugs-and-testing
Browse files Browse the repository at this point in the history
Fix bugs and testing
  • Loading branch information
spiegel-im-spiegel authored Oct 2, 2020
2 parents f4814af + 7c7b9ea commit 2c94130
Show file tree
Hide file tree
Showing 12 changed files with 369 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go text eol=lf
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: build

on:
push:
tags:
- v*
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 22 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['go']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, 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@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
golangci:
strategy:
matrix:
go-version: [1.15.x]
os: [ubuntu-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
- name: testing
run: go test ./...
21 changes: 21 additions & 0 deletions .github/workflows/vulns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: vulns
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
vulns:
name: Vulnerability scanner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ^1.13
- name: WriteGoList
run: go list -json -m all > go.list
- name: Nancy
uses: sonatype-nexus-community/nancy-github-action@main
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [books-data] -- Search for Books Data

[![Build Status](https://travis-ci.org/spiegel-im-spiegel/books-data.svg?branch=master)](https://travis-ci.org/spiegel-im-spiegel/books-data)
[![check vulns](https://github.com/spiegel-im-spiegel/gnkf/workflows/vulns/badge.svg)](https://github.com/spiegel-im-spiegel/gnkf/actions)
[![lint status](https://github.com/spiegel-im-spiegel/gnkf/workflows/lint/badge.svg)](https://github.com/spiegel-im-spiegel/gnkf/actions)
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/spiegel-im-spiegel/books-data/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/spiegel-im-spiegel/books-data.svg)](https://github.com/spiegel-im-spiegel/books-data/releases/latest)

Expand Down
4 changes: 4 additions & 0 deletions clean-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
rm ./go.sum
go clean -cache
go clean -modcache
2 changes: 1 addition & 1 deletion facade/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
var (
usage = []string{ //output message of version
Name + " " + Version,
"Copyright 2019 Spiegel, licensed under Apache License, Version 2.0",
"Copyright 2020 Spiegel, licensed under Apache License, Version 2.0",
}
)

Expand Down
2 changes: 1 addition & 1 deletion facade/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestVersionNormal(t *testing.T) {
out string
outErr string
}{
{args: []string{"version"}, out: "", outErr: "books-data developer version\nCopyright 2019 Spiegel, licensed under Apache License, Version 2.0\n"},
{args: []string{"version"}, out: "", outErr: "books-data developer version\nCopyright 2020 Spiegel, licensed under Apache License, Version 2.0\n"},
}

for _, tc := range testCases {
Expand Down
16 changes: 9 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ module github.com/spiegel-im-spiegel/books-data
go 1.15

require (
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.4.0
github.com/spiegel-im-spiegel/aozora-api v0.2.5
github.com/spiegel-im-spiegel/errs v1.0.0
github.com/spiegel-im-spiegel/gocli v0.10.1
github.com/spiegel-im-spiegel/openbd-api v0.2.5
github.com/spiegel-im-spiegel/pa-api v0.7.1
github.com/spf13/cobra v1.0.1-0.20201001152800-40d34bca1bff
github.com/spf13/viper v1.7.1
github.com/spiegel-im-spiegel/aozora-api v0.2.6
github.com/spiegel-im-spiegel/errs v1.0.2
github.com/spiegel-im-spiegel/gocli v0.10.3
github.com/spiegel-im-spiegel/openbd-api v0.2.6
github.com/spiegel-im-spiegel/pa-api v0.7.2
)

replace github.com/coreos/etcd v3.3.13+incompatible => github.com/coreos/etcd v3.3.25+incompatible
Loading

0 comments on commit 2c94130

Please sign in to comment.