Skip to content

Intializing new version #158

Intializing new version

Intializing new version #158

Workflow file for this run

name: Run Tests on server
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
jobs:
lint:
if: github.event.pull_request.draft != true
name: Run tests
runs-on: ubuntu-latest
timeout-minutes: 20
env:
BACKEND_HOST: 0.0.0.0
BACKEND_PORT: 4747
FRONTEND_HOST: 0.0.0.0
FRONTEND_PORT: 4748
DB_USER: agent
DB_PASSWORD: SUPERSECUREUNCRACKABLEPASSWORD
DB_HOST: localhost
DB_PORT: 3306
DB_NAME: dp_hashcat
ALLOW_REGISTRATIONS: true
DEBUG: true
RESET: true
GRPC_URL: 0.0.0.0:7777
GRPC_TIMEOUT: 10s
TCP_ADDRESS: 0.0.0.0
TCP_PORT: 4749
steps:
# Step 1: Checkout the code
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Copy `initialize.sql` to the workspace
- name: Copy initialization script
run: |
cp ./database/initialize.sql ./initialize.sql
# Step 3: Set up Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23.4
- uses: awalsh128/[email protected]
with:
packages: protobuf-compiler
version: 1.0
# Step 4: Install protoc and Go plugins for protobuf
# sudo apt-get install -y protobuf-compiler
- name: Install protoc and dependencies
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
# Step 5: Set up MariaDB using mariadb-action
- name: Set up MariaDB
uses: getong/[email protected]
with:
mariadb version: 10.9
mysql database: 'dp_hashcat'
mysql root password: SUPERSECUREUNCRACKABLEPASSWORD
# Step 6: Initialize the database with your SQL script
- name: Initialize database with SQL script
run: |
mysql -h 127.0.0.1 -u root -pSUPERSECUREUNCRACKABLEPASSWORD dp_hashcat < initialize.sql
# Step 7: Compile .proto files using Make for the server
- name: Compile proto files
run: |
cd server
make proto
# Step 8: Run tests for the server
- name: Run tests
run: |
cd server
go mod tidy
make test