Skip to content

Commit

Permalink
Merge pull request #1 from JamesJJ/yaml-check
Browse files Browse the repository at this point in the history
GHA:yamllint (Standard YAML formatting)
  • Loading branch information
JamesJJ authored Mar 18, 2021
2 parents 1d01b73 + f002787 commit 9135eb1
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 30 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
name: "CodeQL"
---
name: CodeQL

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

jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
- 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
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
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: go
with:
languages: go
#, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
Expand All @@ -51,5 +52,5 @@ jobs:
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
35 changes: 19 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
---
name: Go

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Format Check
run: cd function && if [ $(gofmt -l -s . | grep -E -v '^vendor/' | tee /tmp/gofmt.txt | wc -l) -ne 0 ]; then echo "fmt failed:"; cat /tmp/gofmt.txt ; exit 1; fi
- name: Format Check
run: cd function && if [ $(gofmt -l -s . | grep -E -v '^vendor/' | tee /tmp/gofmt.txt
| wc -l) -ne 0 ]; then echo "fmt failed:"; cat /tmp/gofmt.txt ; exit 1;
fi

- name: Build
run: cd function && go build -v ./...
- name: Build
run: cd function && go build -v ./...

- name: Test
run: cd function && go test -v -covermode="count" -coverprofile="/tmp/coverage.out"
- name: Coverage Report
run: cd function && go tool cover -func="/tmp/coverage.out"
- name: Test
run: cd function && go test -v -covermode="count" -coverprofile="/tmp/coverage.out"

- name: Coverage Report
run: cd function && go tool cover -func="/tmp/coverage.out"

37 changes: 37 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: YAML

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:

job1:
name: yamllint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: yamllint
uses: ibiqlik/action-yamllint@v3
with:
config_data: |
extends: default
rules:
comments:
require-starting-space: false
comments-indentation: disable
truthy:
check-keys: false
line-length: disable
document-start: disable
document-end: disable
empty-lines:
max: 2
max-end: 2
brackets:
min-spaces-inside: 0
max-spaces-inside: 4
2 changes: 1 addition & 1 deletion aws-serverless/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Resources:
Timeout: 120
MemorySize: 128
Policies:
- AWSLambdaBasicExecutionRole
- AWSLambdaBasicExecutionRole
Environment:
Variables:
LINE_CHANNEL_SECRET: !Ref ChannelSecret
Expand Down

0 comments on commit 9135eb1

Please sign in to comment.