Skip to content

Commit

Permalink
initial release (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
buidav authored Dec 6, 2023
1 parent 06589d7 commit 3f42e3f
Show file tree
Hide file tree
Showing 156 changed files with 50,193 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/get_opa_hash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check OPA Hash
on: [workflow_dispatch]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
ref: main
- name: Get OPA Hash
run: |
cd ./repo/utils
chmod +x checkOPAHash.sh
./checkOPAHash.sh
24 changes: 24 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9.2"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint
- name: Analysing the code with pylint
run: |
pylint -d R0913,R0914,R0915,R1702,W0718,W0719,R0801 $(git ls-files '*.py')
34 changes: 34 additions & 0 deletions .github/workflows/run_opa_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run OPA Tests
on:
# Run tests on each commit, newly opened/reopened PR, and
# PR review submission (e.g. approval)
workflow_dispatch:
push:
paths:
- "**.rego"
pull_request:
types: [opened, reopened]
branches:
- "main"
paths:
- "**.rego"
pull_request_review:
types: [submitted]

jobs:
Run-OPA-Tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Setup OPA
uses: open-policy-agent/setup-opa@v2
with:
version: latest

- name: Run OPA Check
run: opa check rego Testing/RegoTests --strict

- name: Run OPA Tests
run: opa test rego/*.rego Testing/RegoTests/**/*.rego -v
46 changes: 46 additions & 0 deletions .github/workflows/run_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
workflow_dispatch:
inputs:
releaseName:
description: "Release Name (e.g., 1.2.4)"
required: true
type: string
version:
description: "Release Version (e.g., 1.2.4)"
required: true
type: string

name: Build Release

jobs:
build-and-deploy:
runs-on: windows-latest
env:
RELEASE_VERSION: ${{ inputs.version }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
ref: main
- name: Package Repo for release
shell: pwsh
run: |
$PackageName = "scubagoggles"
Remove-Item -Recurse -Force repo -Include .git*
Move-Item -Path repo -Destination "${PackageName}-${env:RELEASE_VERSION}" -Force
Compress-Archive -Path "${PackageName}-${env:RELEASE_VERSION}" -DestinationPath "${PackageName}-${env:RELEASE_VERSION}.zip"
Get-ChildItem -Path . | Write-Output
- name: release
uses: softprops/action-gh-release@v1
id: create_release
with:
draft: true
prerelease: false
name: v${{ inputs.releaseName }}
tag_name: v${{ inputs.version }}
files: scubagoggles-${{ inputs.version }}.zip
generate_release_notes: true
fail_on_unmatched_files: true
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.vscode
.venv
build
scubagoggles.egg-info
.DS_Store
**/__pycache__
**/.DS_Store
**/file.txt
**/token.json
**/credentials.json
**/report/*
**/output*
**/GWSBaselineConformance*
*.bak
opa
opa_windows_amd64.exe
opa_darwin_amd64
opa_linux_amd64_static
Loading

0 comments on commit 3f42e3f

Please sign in to comment.