Skip to content

Commit

Permalink
Implement new CI based on github actions
Browse files Browse the repository at this point in the history
This new CI includes:

- Linux GCC/Clang
- FreeBSD Clang/GCC
- NetBSD GCC/Clang
- OpenBSD Clang/GCC
- Windows GCC/MSVC

Clang on Windows is not my goal. My main concern on Clang is to provide
a functional build for platforms that use it as the default C compiler
(such as FreeBSD) and where the development is really mature. Clang on
Windows (from VS) is buggy, specially when dealing with int scalar type
extension. It is broken since 2015!!! It compiles but not links out.
Nevermind, crappy.
  • Loading branch information
rafael-santiago committed Jan 19, 2025
1 parent 6b0637b commit 7fe4d26
Show file tree
Hide file tree
Showing 20 changed files with 536 additions and 50 deletions.
45 changes: 0 additions & 45 deletions .circleci/config.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/freebsd-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on: push
name: Kryptos FreeBSD CI
jobs:
FreeBSD-Clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: FreeBSD Forge
uses: vmactions/freebsd-vm@v1
with:
sync: rsync
copyback: false
prepare: |
pkg install -y sudo git llvm
usesh: true
run: |
. src/build/ci/freebsd/install-hefesto.sh
cd src
sudo -E hefesto --mk-samples --toolset=clang --no-test-progress
cd .. && sudo rm -rf kryptos
FreeBSD-GCC:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: FreeBSD Forge
uses: vmactions/freebsd-vm@v1
with:
sync: rsync
copyback: false
prepare: |
pkg install -y sudo git lang/gcc
usesh: true
run: |
. src/build/ci/freebsd/install-hefesto.sh
cd src
sudo -E hefesto --mk-samples --toolset=gcc --no-test-progress
cd .. && sudo rm -rf kryptos
39 changes: 39 additions & 0 deletions .github/workflows/linux-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on: push
name: Kryptos Linux CI
jobs:
Linux-GCC:
runs-on: ubuntu-latest
steps:
- name: Clone kryptos repo
uses: actions/checkout@v3
with:
submodules: true
- name: Install basic tools
shell: bash
run: sh src/build/ci/linux/install-basic-tools.sh
- name: Install Hefesto
shell: bash
run: sh src/build/ci/linux/install-hefesto.sh
- name: Run kryptos forge (GCC)
shell: bash
run: |
cd src
sudo -E hefesto --mk-samples --toolset=gcc --no-test-progress
Linux-Clang:
runs-on: ubuntu-latest
steps:
- name: Clone kryptos repo
uses: actions/checkout@v3
with:
submodules: true
- name: Install basic tools
shell: bash
run: sh src/build/ci/linux/install-basic-tools.sh
- name: Install Hefesto
shell: bash
run: sh src/build/ci/linux/install-hefesto.sh
- name: Run kryptos forge (Clang)
shell: bash
run: |
cd src
sudo -E hefesto --mk-samples --toolset=clang --no-test-progress
41 changes: 41 additions & 0 deletions .github/workflows/netbsd-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on: push
name: Kryptos NetBSD CI
jobs:
NetBSD-GCC:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: NetBSD Forge
uses: vmactions/netbsd-vm@v1
with:
sync: rsync
copyback: false
prepare: |
/usr/sbin/pkg_add sudo git gcc*
shell: bash
run: |
. src/build/ci/netbsd/install-hefesto.sh
cd src
sudo -E hefesto --mk-samples --toolset=gcc --no-test-progress
cd .. && sudo rm -rf kryptos
NetBSD-Clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: NetBSD Forge
uses: vmactions/netbsd-vm@v1
with:
sync: rsync
copyback: false
prepare: |
/usr/sbin/pkg_add sudo git clang*
shell: bash
run: |
. src/build/ci/netbsd/install-hefesto.sh
cd src
sudo -E hefesto --mk-samples --toolset=clang --no-test-progress
cd .. && sudo rm -rf kryptos
42 changes: 42 additions & 0 deletions .github/workflows/openbsd-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on: push
name: Kryptos OpenBSD CI
jobs:
OpenBSD-Clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: OpenBSD Forge
uses: vmactions/openbsd-vm@v1
with:
sync: rsync
copyback: false
prepare: |
pkg_add sudo-1.9.15.5p0 git-2.46.1 llvm-17.0.6p12
usesh: true
run: |
. src/build/ci/netbsd/install-hefesto.sh
cd src
sudo -E hefesto --mk-samples --toolset=clang --no-test-progress
cd .. && sudo rm -rf kryptos
OpenBSD-GCC:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: OpenBSD Forge
uses: vmactions/openbsd-vm@v1
with:
sync: rsync
copyback: false
prepare: |
pkg_add sudo-1.9.15.5p0 git-2.46.1 gcc-11.2.0p14 gcc-libs-11.2.0p14
usesh: true
run: |
. src/build/ci/netbsd/install-hefesto.sh
ln -sf `which egcc` /usr/bin/gcc
cd src
sudo -E hefesto --mk-samples --toolset=gcc --no-test-progress
cd .. && sudo rm -rf kryptos
35 changes: 35 additions & 0 deletions .github/workflows/windows-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on: push
name: Kryptos Windows CI
jobs:
Windows-GCC:
runs-on: windows-latest
steps:
- name: Clone kryptos repo
uses: actions/checkout@v3
with:
submodules: true
- name: Install Hefesto
shell: cmd
run: |
src\build\ci\windows\install-hefesto.bat && RefreshEnv.cmd && hefesto --version
- name: Run kryptos forge
shell: cmd
run: |
RefreshEnv.cmd && cd src && hefesto --toolset=gcc --mk-samples --no-test-progress
Windows-MSVC:
runs-on: windows-latest
steps:
- name: Clone kryptos repo
uses: actions/checkout@v3
with:
submodules: true
- name: Install Hefesto
shell: cmd
run: |
src\build\ci\windows\install-hefesto.bat && RefreshEnv.cmd
- name: Run kryptos forge
shell: cmd
run: |
choco install -y visualstudio2022buildtools --package-parameters "--includeRecommended --includeOptional --add Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64 --passive --locale en-US"
choco install -y visualstudio2022-workload-vctools --package-parameters "--includeRecommended --add Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64 --passive"
RefreshEnv.cmd && cd src && hefesto --toolset=msvc --mk-samples --no-test-progress
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Kryptos [![CircleCI](https://circleci.com/gh/rafael-santiago/kryptos/tree/main.svg?style=svg)](https://circleci.com/gh/rafael-santiago/kryptos/tree/main)
# Kryptos

![linux-ci](https://github.com/rafael-santiago/kryptos/actions/workflows/linux-forge.yml/badge.svg?branch=main) ![freebsd-ci](https://github.com/rafael-santiago/kryptos/actions/workflows/freebsd-forge.yml/badge.svg?branch=main) ![netbsd-ci](https://github.com/rafael-santiago/kryptos/actions/workflows/netbsd-forge.yml/badge.svg?branch=main) ![openbsd-ci](https://github.com/rafael-santiago/kryptos/actions/workflows/openbsd-forge.yml/badge.svg?branch=main) ![windows-ci](https://github.com/rafael-santiago/kryptos/actions/workflows/windows-forge.yml/badge.svg?branch=main)

I started the core of this project on about 2004 and since then it is being an attempt of building a tiny and straightforward
crypto library which can be easily integrated with user and also kernel mode code.
Expand Down
19 changes: 19 additions & 0 deletions src/build/ci/freebsd/install-hefesto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/bash

#
# Copyright (C) 2025 by Rafael Santiago
#
# This is a free software. You can redistribute it and/or modify under
# the terms of the GNU General Public License version 2.
#
#

git clone https://github.com/rafael-santiago/hefesto --recursive
cd hefesto/src
printf "\n" > blau.txt
sudo ./build.sh < blau.txt
HEFESTO_INCLUDES_HOME="/usr/local/share/hefesto/include"; export HEFESTO_INCLUDES_HOME
HEFESTO_MODULES_HOME="/usr/local/share/hefesto/module"; export HEFESTO_MODULES_HOME
sudo chown -R $USER /usr/local/share/hefesto
cd ../..
rm -rf hefesto
3 changes: 3 additions & 0 deletions src/build/ci/linux/deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
git
gcc-9
clang
19 changes: 19 additions & 0 deletions src/build/ci/linux/install-basic-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/bash

#
# Copyright (C) 2025 by Rafael Santiago
#
# This is free software. You can redistribute it and or/modify under
# the terms of the GNU General Public License version 2.
#
#


deps_file=$(dirname $0)/deps.txt

sudo apt-get update

for dep in `cat $deps_file`
do
sudo apt-get install -y $dep
done
19 changes: 19 additions & 0 deletions src/build/ci/linux/install-hefesto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/bash

#
# Copyright (C) 2025 by Rafael Santiago
#
# This is a free software. You can redistribute it and/or modify under
# the terms of the GNU General Public License version 2.
#
#

git clone https://github.com/rafael-santiago/hefesto --recursive
cd hefesto/src
printf "\n" > blau.txt
sudo ./build.sh < blau.txt
echo "HEFESTO_INCLUDES_HOME=/usr/local/share/hefesto/include" >> "$GITHUB_ENV"
echo "HEFESTO_MODULES_HOME=/usr/local/share/hefesto/module" >> "$GITHUB_ENV"
sudo chown -R $USER /usr/local/share/hefesto
cd ../..
rm -rf hefesto
19 changes: 19 additions & 0 deletions src/build/ci/netbsd/install-hefesto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/bash

#
# Copyright (C) 2025 by Rafael Santiago
#
# This is a free software. You can redistribute it and/or modify under
# the terms of the GNU General Public License version 2.
#
#

git clone https://github.com/rafael-santiago/hefesto --recursive
cd hefesto/src
printf "\n" > blau.txt
sudo ./build.sh < blau.txt
HEFESTO_INCLUDES_HOME="/usr/local/share/hefesto/include"; export HEFESTO_INCLUDES_HOME
HEFESTO_MODULES_HOME="/usr/local/share/hefesto/module"; export HEFESTO_MODULES_HOME
sudo chown -R $USER /usr/local/share/hefesto
cd ../..
rm -rf hefesto
14 changes: 14 additions & 0 deletions src/build/ci/netbsd/install-pkgsrc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/bash

#
# Copyright (C) 2025 by Rafael Santiago
#
# This is a free software. You can redistribute it and/or modify under
# the terms of the GNU General Public License version 2.
#
#

ftp ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz
sudo tar -xzf pkgsrc.tar.gz -C /usr
PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/$(uname -s)/$(uname -m)/$(uname -r | cut -f '1 2' -d.)/All"
export PATH PKG_PATH
Loading

0 comments on commit 7fe4d26

Please sign in to comment.