Skip to content

Commit

Permalink
Add security workflows; combine lint and test workflows (#60)
Browse files Browse the repository at this point in the history
* Combine lint and test workflows

* Add security workflows
  • Loading branch information
zliang-akamai authored Dec 20, 2024
1 parent 421f02c commit 03947f9
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 30 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 13 * * 5'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write

strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality


- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
19 changes: 19 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Dependency review'
on:
pull_request:
branches: [ "main" ]

permissions:
contents: read
pull-requests: write

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: on-failure
21 changes: 0 additions & 21 deletions .github/workflows/lint.yaml

This file was deleted.

15 changes: 6 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
name: Run Tests
name: Continues Integration

on: [ push, pull_request, workflow_dispatch ]

jobs:
run-tests:
lint-test:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

- name: update packages
run: sudo apt-get update -y

- name: install make
run: sudo apt-get install -y build-essential

- name: setup python 3
uses: actions/setup-python@v5
with:
Expand All @@ -24,4 +18,7 @@ jobs:
run: make getdeps && pip3 install -r requirements-dev.txt

- name: run tests
run: make test
run: make test

- name: run linter
run: make lint

0 comments on commit 03947f9

Please sign in to comment.