Skip to content

Commit

Permalink
build: Added basic CI support
Browse files Browse the repository at this point in the history
  • Loading branch information
dol committed Dec 26, 2024
1 parent 85426ae commit f535836
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Lint

on:
pull_request: {}
workflow_dispatch: {}
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lua-check:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT || 10) }}
name: Lua Check
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
checks: write
pull-requests: write
if: (github.actor != 'dependabot[bot]')

steps:
- name: Checkout source code
uses: actions/checkout@v3

# Optional step to run on only changed files
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@54849deb963ca9f24185fb5de2965e002d066e6b # v37
with:
files: |
**.lua
- name: Lua Check
if: steps.changed-files.outputs.any_changed == 'true'
uses: Kong/public-shared-actions/code-check-actions/lua-lint@a98be0184f832cb24a9dd233f99074e8ba17b488 # v2.3.3
with:
additional_args: '--no-default-config --config .luacheckrc'
files: ${{ steps.changed-files.outputs.all_changed_files }}
action_fail: true
28 changes: 28 additions & 0 deletions .github/workflows/sast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: SAST

on:
pull_request: {}
push:
branches:
- master
- main
workflow_dispatch: {}


jobs:
semgrep:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT || 10) }}
name: Semgrep SAST
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read

if: (github.actor != 'dependabot[bot]')

steps:
- uses: actions/checkout@v3
- uses: Kong/public-shared-actions/security-actions/semgrep@33449c46c6766a3d3c8f167cc383381225862b36
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test

on: [push, pull_request]

jobs:

tests:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT || 10) }}
name: Busted Tests

runs-on: ubuntu-latest

steps:
- name: Run tests
run: |
make test-unit

0 comments on commit f535836

Please sign in to comment.