Skip to content

DRAFT: Create Workflow Actions #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Clone Repos, Install Elixir, and Ensure JSON Schemas can be exported.

on:
push:
branches:
- main

pull_request:
branches:
- main

workflow_dispatch: # Allows manual triggering of the workflow

jobs:
setup-elixir-and-run:
runs-on: ubuntu-latest

steps:

# Clone the ocsf-server repository
- name: Clone ocsf-server Repository
run: |
git clone https://github.com/ocsf/ocsf-server
echo "Cloned ocsf/ocsf-server"

# Clone the ocsf-schema repository (v1.0.0-rc.2)
- name: Clone ocsf-schema Repository
run: |
git clone --branch v1.0.0-rc.2 https://github.com/ocsf/ocsf-schema
echo "Cloned ocsf/ocsf-schema:v1.0.0-rc.2"

# Checkout the current repository
- name: Checkout Current Repository into ocsf-schema/extensions/splunk
uses: actions/checkout@v3
with:
path: ocsf-schema/extensions/splunk

# Install Elixir
- name: Install Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.14' # Define the elixir version [required]
otp-version: '25.0' # Define the OTP version [required]

# Restore depedencies cache
- name: Restore Dependencies Cache
uses: actions/cache@v3
with:
path: ocsf-server/deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

# Install Dependencies
- name: Install Server Dependencies
working-directory: ocsf-server
run: |
mix deps.get
echo "Dependencies installed for ocsf-server"

# Run ocsf-server tests
- name: Run Server Tests
working-directory: ocsf-server
run: |
SCHEMA_DIR=../ocsf-schema mix test
echo "Tests completed for ocsf-server"

# Test the JSON schema export for the Authentication class
- name: Test JSON Schema Export for Authentication Class
working-directory: ocsf-server
run: |
SCHEMA_DIR=../ocsf-schema iex -S mix phx.server
echo "JSON schema export completed for Authentication class"
Loading