Skip to content

Commit

Permalink
ci: adding C Continuous Integration (CI)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 committed Apr 20, 2024
1 parent f2db51a commit b7acc87
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Continuous Integration (CI)

on: pull_request

env:
# Forcing Earthly to use colours, to make reading output easier.
FORCE_COLOR: 1

jobs:
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Download Earthly v0.8.6.
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.6/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Checkout code.
uses: actions/checkout@v3
- name: Compile.
run: earthly --ci +compile
12 changes: 12 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,15 @@ check-github-actions-workflows-linting:
RUN go install github.com/rhysd/actionlint/cmd/[email protected]
DO +COPY_CI_DATA
RUN ./ci/check-github-actions-workflows-linting.sh


COPY_SOURCECODE:
COMMAND
DO +COPY_CI_DATA
COPY --dir "src/" "tests/" "./"


compile:
FROM gcc:13.2.0
DO +COPY_SOURCECODE
RUN ./ci/compile.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NASM x86 Shellcode Generator
[![Pipeline Status](https://gitlab.com/DeveloperC/nasm-x86-shellcode-generator/badges/master/pipeline.svg)](https://gitlab.com/DeveloperC/nasm-x86-shellcode-generator/-/pipelines)
[![Continuous Integration (CI)](https://github.com/DeveloperC286/nasm-x86-shellcode-generator/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/DeveloperC286/nasm-x86-shellcode-generator/actions/workflows/continuous-integration.yml)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![License](https://img.shields.io/badge/License-AGPLv3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

Expand Down
6 changes: 6 additions & 0 deletions ci/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

set -o errexit
set -o xtrace

gcc -o "shellcode-generator" "src/shellcode-generator.c"

0 comments on commit b7acc87

Please sign in to comment.