diff --git a/.woodpecker/woodpecker.yaml b/.woodpecker/woodpecker.yaml index 1d860cc..1d2f46f 100644 --- a/.woodpecker/woodpecker.yaml +++ b/.woodpecker/woodpecker.yaml @@ -1,4 +1,11 @@ steps: + - name: Format-Code + image: alpine + commands: + - apk add --no-cache g++ libc-dev git clang clang-extra-tools + - echo "Formatting project..." + - find ./ -type f -name "*.cpp" -o -name "*.h" | xargs clang-format -i + - name: Build image: alpine commands: @@ -7,6 +14,8 @@ steps: - echo "Building project..." - g++ -O2 -static -o build/main main.cpp - chmod +x build/main + depends_on: + - Format-Code - name: Check Static image: alpine @@ -25,14 +34,6 @@ steps: depends_on: - Build - - name: Test-Arch - image: archlinux/archlinux - commands: - - pacman -Sy --noconfirm bash glibc - - bash -c "./build/main" - depends_on: - - Build - - name: discord notification image: appleboy/drone-discord settings: @@ -46,17 +47,18 @@ steps: {{/success}} depends_on: - Build - - Test-Arch - Test-Debian - name: Confirm-Build image: alpine commands: + - echo "Checking for changes..." + - git add . + - git diff --cached --quiet || (git commit -m "Apply clang-format changes [skip ci]" && git push origin HEAD) - ls -al build - echo "Build is mint!" depends_on: - Build - - Test-Arch - Test-Debian - name: Release diff --git a/main.cpp b/main.cpp index dc6b117..d6b33b3 100644 --- a/main.cpp +++ b/main.cpp @@ -1,29 +1,6 @@ #include using namespace std; - -int main() { - int i,n; - float suma; - int f[100], f0, f1; - float zl; - - - cout << "N = "; - cin >> n; - f0 = 0; - f1 = 1; - cout << f0 << " " << f1 << " "; - for(i = 2;i<=n;i++) { - suma = f0 + f1; - cout << suma << " "; - f0 = f1; - f1 = suma; - } - - zl = suma/f0; - - cout << "\nZlota liczba = " << zl << endl; - - system("pause"); - return 0; -} \ No newline at end of file +int main() { int i,n; float suma; int f0=0,f1=1; float zl; +cout << "N = "; cin >> n; cout << f0 << " " << f1 << " "; +for(i=2;i<=n;i++) { suma=f0+f1; cout << suma << " "; f0=f1; f1=suma; } +zl=suma/f0; cout << "\nZlota liczba = " << zl << endl; return 0; }