Skip to content

Commit

Permalink
Add GitHub Actions Code Quality and Units workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
a-b committed Jan 25, 2022
1 parent 8c55154 commit dcf5ea6
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paths-ignore:
- cf
- util/ui/request_logger_terminal_display.go
35 changes: 35 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Code Quality"

on:
push:
branches: [ master, '*' ]
pull_request:
branches: [ master ]
schedule:
- cron: '45 5 * * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:

- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: go
config-file: ./.github/codeql/codeql-config.yml

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
113 changes: 113 additions & 0 deletions .github/workflows/units.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Units Tests

on:
push:
branches:
- "*"

permissions:
contents: write

defaults:
run:
shell: bash

jobs:
lint:
name: Lint code
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.17
-
name: Run go fmt
run: go fmt && git diff --exit-code

units-linux:
name: Units Linux
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.17
-
name: Set up Test
run: |
go get -u github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/matchers@v1.10.5
-
name: Run Linux Units
run: make units
env:
ACK_GINKGO_RC: true

units-macos:
name: Units OS X
runs-on: macos-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.17
-
name: Set up Test
run: |
go get -u github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/matchers@v1.10.5
-
name: Run MacOS Units
run: make units
env:
ACK_GINKGO_RC: true

units-windows:
name: Units Windows
runs-on: windows-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.17
-
name: Set up Test
run: |
go get -u github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/matchers@v1.10.5
-
name: Run Windows Units
shell: pwsh
run: >
ginkgo -r -p
-randomizeAllSpecs
-randomizeSuites
-skipPackage integration,cf\ssh,plugin,cf\actors\plugin,cf\commands\plugin,cf\actors\plugin,util\randomword
-flakeAttempts=2
env:
ACK_GINKGO_RC: true
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.13
// +build go1.13

package main
Expand Down

0 comments on commit dcf5ea6

Please sign in to comment.