Skip to content

Commit ad542f4

Browse files
authored
fix: issue #42 bump-up CodeQL action v1 --> v2 (PR #49)
fix #42 - Removed redundant comments in the action as well
1 parent ef0fad4 commit ad542f4

File tree

5 files changed

+20
-133
lines changed

5 files changed

+20
-133
lines changed

.github/ABOUT_TESTS.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
.
55
├── Dockerfile ................ Alpine-base image for docker-compose.
66
├── SECURITY.md ............... Security policy of this repo.
7-
├── check-requirements.sh ..... Shell script to check requirements to run
8-
`run-tests-merge.sh`.
97
├── docker-compose.yml ........ Docker-compose file to run the tests in various
108
│ contidions.
119
├── mergify.yml ............... Configuration for auto-merge PRs using
@@ -17,8 +15,6 @@
1715
├── run-tests-go-install.sh ... Shell script to test app installation via
1816
`go install` in Go 1.16+ (monthly run).
1917
├── run-tests-lint.sh ......... Shall script to run `golangci-lint`.
20-
├── run-tests-merge.sh ........ Battery of tests which will run static analysis
21-
│ and linters for both shell script and Go source.
2218
├── update-go-mod.sh .......... Updates the "go.mod" and "go.sum" files to the
2319
│ latest.
2420
└── workflows/ ................ Directory for CIs via GitHub Actions.
@@ -27,12 +23,6 @@
2723

2824
## To test via Docker (docker-compose)
2925

30-
- All-in-one (Go: latest version, Unit Test, Lint check and static analysis)
31-
32-
```bash
33-
docker-compose --file ./.github/docker-compose.yml run mergeability
34-
```
35-
3626
- Unit test on various Go versions
3727

3828
```bash

.github/check-requirements.sh

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/mergify.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ pull_request_rules:
44
- "#approved-reviews-by>=2"
55
- base=main
66
- check-success=lint
7-
- check-success=Analyze (go)
8-
- check-success=Run tests on Go via container
7+
- check-success=Analyze
8+
- check-success=Run code coverage via container
9+
- check-success=Run tests on various Go versions via container
910
- check-success=Platform test (ubuntu-latest)
1011
- check-success=Platform test (macos-latest)
1112
- check-success=Platform test (windows-latest)
@@ -18,8 +19,9 @@ pull_request_rules:
1819
- files~=.\.(?i)(md)$
1920
- base=main
2021
- check-success=lint
21-
- check-success=Analyze (go)
22-
- check-success=Run tests on Go via container
22+
- check-success=Analyze
23+
- check-success=Run code coverage via container
24+
- check-success=Run tests on various Go versions via container
2325
- check-success=Platform test (ubuntu-latest)
2426
- check-success=Platform test (macos-latest)
2527
- check-success=Platform test (windows-latest)
@@ -35,8 +37,9 @@ pull_request_rules:
3537
- files=go.mod
3638
- files=go.sum
3739
- "#files=2"
38-
- check-success=Analyze (go)
39-
- check-success=Run tests on Go via container
40+
- check-success=Analyze
41+
- check-success=Run code coverage via container
42+
- check-success=Run tests on various Go versions via container
4043
- check-success=Platform test (ubuntu-latest)
4144
- check-success=Platform test (macos-latest)
4245
- check-success=Platform test (windows-latest)
Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
1+
# Security vulnerability scanning using CodeQL, the semantic code analysis engine.
2+
# See:
3+
# https://github.com/github/codeql-action
4+
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#go
75
name: "CodeQL"
86

97
on:
@@ -19,47 +17,21 @@ jobs:
1917
name: Analyze
2018
runs-on: ubuntu-latest
2119
permissions:
22-
actions: read
23-
contents: read
2420
security-events: write
2521

26-
strategy:
27-
fail-fast: false
28-
matrix:
29-
language: [ 'go' ]
30-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
31-
# Learn more:
32-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
33-
3422
steps:
3523
- name: Checkout repository
3624
uses: actions/checkout@v3
3725

3826
# Initializes the CodeQL tools for scanning.
3927
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v1
28+
uses: github/codeql-action/init@v2
4129
with:
42-
languages: ${{ matrix.language }}
43-
# If you wish to specify custom queries, you can do so here or in a config file.
44-
# By default, queries listed here will override any specified in a config file.
45-
# Prefix the list here with "+" to use these queries and those in the config file.
46-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
30+
languages: go
4731

48-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
49-
# If this step fails, then you should remove it and run the build manually (see below)
32+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
5033
- name: Autobuild
51-
uses: github/codeql-action/autobuild@v1
52-
53-
# ℹ️ Command-line programs to run using the OS shell.
54-
# 📚 https://git.io/JvXDl
55-
56-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
57-
# and modify them (or add more) to build your code if your project
58-
# uses a compiled language
59-
60-
#- run: |
61-
# make bootstrap
62-
# make release
34+
uses: github/codeql-action/autobuild@v2
6335

6436
- name: Perform CodeQL Analysis
65-
uses: github/codeql-action/analyze@v1
37+
uses: github/codeql-action/analyze@v2

.github/workflows/coverage-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
jobs:
1515
go:
16-
name: Run tests on Go via container
16+
name: Run code coverage via container
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout repo
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/cache@v3
3636
with:
3737
path: ${{ env.PATH_CACHE }}
38-
key: ${{ steps.cacheid.outputs.hash }}
38+
key: coverage-${{ steps.cacheid.outputs.hash }}
3939

4040
- name: Load Docker images if exist
4141
if: steps.cache.outputs.cache-hit == 'true'

0 commit comments

Comments
 (0)