Skip to content

Commit

Permalink
github
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman committed Nov 20, 2024
1 parent 3a87aef commit ae2cd3e
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
48 changes: 48 additions & 0 deletions .github/workflow/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Precommit

on:
push:
branches:
- trunk
pull_request:
branches:
- trunk

jobs:
build:
strategy:
matrix:
compiler:
- gcc
- clang
optimization_level:
- -O0
- -O3
sanitizers:
- ''
- 'address,leak'

runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update
sudo apt install build-essential
sudo apt install gcc
sudo apt install clang clang-format clang-tidy
sudo apt install bear
- name: Build
run: bear -- make compile

- name: Test
run: make

- name: Check Format
run: make check-format

- name: Check Style
run: make check-style
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ BUILD_DIR = build
OBJ_DIR = $(BUILD_DIR)/obj
BIN_DIR = $(BUILD_DIR)/bin

OPTIMIZATION_LEVEL ?= 3
COMPILER ?= clang
OPTIMIZATION_LEVEL ?= -O3
SANITIZERS ?=

CC = clang
CC = $(COMPILER)

CFLAGS = -g -I $(SRC_DIR)
CFLAGS += -Wall -Werror
CFLAGS += -fno-omit-frame-pointer
CFLAGS += -O$(OPTIMIZATION_LEVEL)
CFLAGS += $(OPTIMIZATION_LEVEL)
CFLAGS += -fsanitize=$(SANITIZERS)

LDFLAGS = $(CFLAGS)
Expand Down

0 comments on commit ae2cd3e

Please sign in to comment.