Skip to content

Commit

Permalink
Merge pull request #6113 from osalyk/workflows_read
Browse files Browse the repository at this point in the history
common: harden GitHub Actions
  • Loading branch information
janekmi committed Sep 26, 2024
2 parents fe81dd2 + 66cf363 commit 11e2c43
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker_rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ env:
WORKDIR: utils/docker
PUSH_IMAGE: 1

permissions: {}

jobs:
image:
if: github.repository == 'pmem/pmdk'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
workflow_dispatch:
pull_request:

permissions: {}

jobs:
src_checkers:
name: Source checkers
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ env:
PMDK_CXX: g++
SRC_CHECKERS: 0

permissions: {}

jobs:
in-tree:
name: In-tree
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pmem_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ on:
type: string
default: master

permissions: {}

jobs:
prep_runtime:
name: Prepare runtime
runs-on: [self-hosted, benchmark]
permissions:
contents: read
steps:
- name: Clone the git repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -38,8 +37,6 @@ jobs:
GITHUB_REF: ${{ inputs.reference_ref }}
- ROLE: rival
GITHUB_REF: ${{ inputs.rival_ref }}
permissions:
contents: read
env:
MANIFEST: ${{ matrix.ROLE }}/manifest.txt
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pmem_ras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ on:
# run this job every 8 hours
- cron: '0 */8 * * *'

permissions: {}

jobs:
linux:
name: PMEM_RAS
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pmem_test_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
type: number
default: 360 # The jobs.<job_id>.timeout-minutes default.

permissions: {}

jobs:
job:
name: ${{ matrix.force_enable }}, ${{ matrix.test_script }}, ${{ matrix.os }}, ${{ matrix.build }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pmem_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
# run this job at 18:00 UTC every day
- cron: '0 18 * * *'

permissions: {}

jobs:
# Test the default build with the basic test suite.
Basic:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan_bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ env:
PMREORDER: src/tools/pmreorder/*.py
CALL_STACKS_ANALYSIS: utils/call_stacks_analysis/*.py

permissions: {}

jobs:
bandit:
name: Bandit
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/scan_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ name: CodeQL
on:
workflow_call:

permissions:
actions: read
contents: read
security-events: write

jobs:
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Clone the git repo
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ env:
TEST_BUILD: debug
FAULT_INJECTION: 1

permissions: {}

jobs:
linux:
name: Linux
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan_coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ env:
VALGRIND: 1
COVERITY: 1

permissions: {}

jobs:
linux:
name: Linux
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Documentation
on:
workflow_call:

permissions: {}

jobs:
linux:
name: Documentation
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scan_log_calls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflow_dispatch:
workflow_call:

permissions: {}

jobs:
log-calls:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan_stack_usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
env:
CALL_STACKS_TOOLS_PATH: pmdk/utils/call_stacks_analysis

permissions: {}

jobs:
stack-usage:
name: Stack usage
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scan_ubsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ env:
UBSAN: 1
FAULT_INJECTION: 1

permissions: {}

jobs:
linux:
name: Linux
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ on:
# run this job at 00:00 UTC every day
- cron: '0 0 * * *'

permissions: {}

jobs:
call-bandit:
uses: ./.github/workflows/scan_bandit.yml
name: Bandit
call-codeql:
uses: ./.github/workflows/scan_codeql.yml
name: CodeQL
permissions:
actions: read
contents: read
security-events: write
call-coverity:
uses: ./.github/workflows/scan_coverity.yml
secrets:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ env:
GITHUB_REPO: pmem/pmdk
DOCKER_REPO: ghcr.io/pmem/pmdk

permissions: {}

jobs:
linux:
name: Linux
Expand Down

0 comments on commit 11e2c43

Please sign in to comment.