Skip to content
Merged
Show file tree
Hide file tree
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
45 changes: 45 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI/CD

on:
workflow_dispatch:
workflow_call:
pull_request:
push:
branches:
- main
- dev
paths:
- "src/**/**.rs"
- "crates/**/**.rs"
- "kernel/*.rs"

jobs:
quality-gate:
permissions:
contents: read

uses: RustLangES/.github/.github/workflows/quality-gate.yml@main
with:
runs-on: ubuntu-latest
checks-command: "--all --check"
clippy-command: "-- -D warnings"
tests-command: "test"

build:
permissions:
contents: read

needs: quality-gate
name: Build
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
with:
toolchain: stable

- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: build
args: "--release --all-features"
22 changes: 0 additions & 22 deletions .github/workflows/quality-gate.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release Build and Publish

permissions:
contents: write

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
release_name:
description: "Name of release"
required: false
default: ""

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Release Build and Publish' step
Uses Step
uses 'dtolnay/rust-toolchain' with ref 'stable', not a pinned commit hash

- name: Build release
run: cargo build --release

- name: Convert BIOS image to ISO
run: |
mkdir -p isos
cp target/bios.img isos/bios.img
xorriso -as mkisofs -o isos/bios.iso isos/bios.img

- name: Convert UEFI image to ISO
run: |
cp target/uefi.img isos/uefi.img
xorriso -as mkisofs -o isos/uefi.iso isos/uefi.img

- name: Get tag or manual release name
id: tag_name
run: |
if [ -n "${{ github.event.inputs.release_name }}" ]; then
echo "RELEASE_NAME=${{ github.event.inputs.release_name }}" >> $GITHUB_ENV
else
echo "RELEASE_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi

- name: Get commit history with mentions
id: commit_history
run: |
if [ -n "${{ github.event.inputs.release_name }}" ]; then
# Si es un lanzamiento manual, muestra los últimos 10 commits
echo "COMMIT_HISTORY=$(git log --pretty=format:'- %s (by @%an)' -n 10)" >> $GITHUB_ENV
else
# Si es un lanzamiento automático, muestra los commits desde el último tag
echo "COMMIT_HISTORY=$(git log --pretty=format:'- %s (by @%an)' $(git describe --tags --abbrev=0)..HEAD)" >> $GITHUB_ENV
fi

- name: Create Release
uses: softprops/action-gh-release@v2

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Release Build and Publish' step
Uses Step
uses 'softprops/action-gh-release' with ref 'v2', not a pinned commit hash
with:
tag_name: ${{ env.RELEASE_NAME }}
name: ${{ env.RELEASE_NAME }}
body: ${{ env.COMMIT_HISTORY }}
files: |
isos/bios.iso
isos/uefi.iso
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
all: build lint fmt test run

build:
cargo build

Expand All @@ -11,4 +13,7 @@ fmt-fix:
cargo fmt

test:
cargo test
cargo test

run:
cargo run
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@

Memsos is a tool written in rust with the objective to check your memory in a fast way, memsos works for both uefi and bios.

## Requirements

If using arch you need to install `qemu-system-x86`

## Generate Images

To generate the images we only need to run `cargo build`, they are created in `target/`.
Then we can try it with `cargo run`

### In dev
Loading