Skip to content

Commit

Permalink
Possible fix for dependabot issues and add CodeQL workflow (#2606)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpotter92 authored Sep 28, 2022
1 parent d4fad49 commit dc6e79d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 23 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Build binaries

on:
pull_request_target:
pull_request:
push:
branches:
- master
tags:
- "v*"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
name: Build binaries for ${{ matrix.platform.name }}-${{ matrix.arch }}
Expand Down Expand Up @@ -155,15 +160,9 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17

- name: Cache go modules
id: cache-go-mod
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum

- name: Cache ffmpeg
id: cache-ffmpeg
Expand Down Expand Up @@ -198,7 +197,7 @@ jobs:
&& sudo ldconfig
- name: Install go modules
if: steps.cache-go-mod.outputs.cache-hit != 'true'
if: steps.go.outputs.cache-hit != 'true'
run: go mod download

- name: Install ffmpeg
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Docker build

on:
pull_request_target:
pull_request:
push:
branches:
- master
tags:
- "v*"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
name: Docker image generation
Expand Down Expand Up @@ -45,8 +50,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASS }}
username: ${{ secrets.CI_DOCKERHUB_USERNAME }}
password: ${{ secrets.CI_DOCKERHUB_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@v2
Expand Down
47 changes: 36 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
name: Trigger test suite

on:
pull_request_target:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: Run tests defined for the project
Expand All @@ -26,15 +33,9 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17

- name: Cache go modules
id: cache-go-mod
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum

- name: Cache ffmpeg
id: cache-ffmpeg
Expand All @@ -58,7 +59,7 @@ jobs:
&& sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 30
- name: Install go modules
if: steps.cache-go-mod.outputs.cache-hit != 'true'
if: steps.go.outputs.cache-hit != 'true'
run: go mod download

- name: Install ffmpeg
Expand Down Expand Up @@ -93,6 +94,30 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: ./cover.out
name: go-livepeer
name: ${{ github.event.repository.name }}
verbose: true
gcov_ignore: ./eth/stubclient.go

codeql:
name: Perform CodeQL analysis
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
# Check https://github.com/livepeer/go-livepeer/pull/1891
# for ref value discussion
ref: ${{ github.event.pull_request.head.sha }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

0 comments on commit dc6e79d

Please sign in to comment.