Skip to content

Commit

Permalink
run on host
Browse files Browse the repository at this point in the history
  • Loading branch information
m-tmatma committed Dec 14, 2024
1 parent b7b4076 commit 1ca3b4f
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: build
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt update
sudo apt install -y make gcc g++ cmake git
- name: Checkout GitLab repository
run: |
git clone https://gitlab.com/saalen/astyle.git
- name: build
run: |
cd astyle
mkdir build
cmake -S . -B build
cmake --build build
cmake --build build --target install
astyle --version
- run: ./run2.sh

- name: artifact
uses: actions/upload-artifact@v4
with:
name: output
path: output/
29 changes: 29 additions & 0 deletions run2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

styles=(
"allman"
"java"
"kr"
"stroustrup"
"whitesmith"
"vtk"
"ratliff"
"gnu"
"linux"
"horstmann"
"1tbs"
"google"
"mozilla"
"webkit"
"pico"
"lisp"
)

rm -rf output
for style in "${styles[@]}"; do
mkdir -p "output/$style"
cp -a src/* "output/$style"
echo "Running $style"
astyle -n --add-braces --style=$style "output/$style/main.c"
done

0 comments on commit 1ca3b4f

Please sign in to comment.