gitea actions
Algunas comprobaciones han fallado
CI (Gitea) / Test (nightly) (push) Has been cancelled
CI (Gitea) / Test (stable) (push) Has been cancelled
CI (Gitea) / Cross Compile (i686-unknown-linux-gnu) (push) Has been cancelled
CI (Gitea) / Test (beta) (push) Successful in 24m44s
CI (Gitea) / Build Release (push) Has been skipped
CI (Gitea) / Cross Compile (aarch64-unknown-linux-gnu) (push) Has been skipped
CI (Gitea) / Integration Tests (push) Has been skipped
Algunas comprobaciones han fallado
CI (Gitea) / Test (nightly) (push) Has been cancelled
CI (Gitea) / Test (stable) (push) Has been cancelled
CI (Gitea) / Cross Compile (i686-unknown-linux-gnu) (push) Has been cancelled
CI (Gitea) / Test (beta) (push) Successful in 24m44s
CI (Gitea) / Build Release (push) Has been skipped
CI (Gitea) / Cross Compile (aarch64-unknown-linux-gnu) (push) Has been skipped
CI (Gitea) / Integration Tests (push) Has been skipped
Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
202
.gitea/workflows/ci.yml
Archivo normal
202
.gitea/workflows/ci.yml
Archivo normal
@@ -0,0 +1,202 @@
|
|||||||
|
name: CI (Gitea)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, develop, master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main, master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
rust: [stable, beta, nightly]
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential gcc libc6-dev
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
toolchain: ${{ matrix.rust }}
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: Cache cargo registry
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-${{ matrix.rust }}-
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
|
- name: Cache target directory
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: target
|
||||||
|
key: ${{ runner.os }}-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-target-${{ matrix.rust }}-
|
||||||
|
${{ runner.os }}-target-
|
||||||
|
|
||||||
|
- name: Show Rust version
|
||||||
|
run: |
|
||||||
|
rustc --version
|
||||||
|
cargo --version
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
- name: Run clippy
|
||||||
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test --verbose
|
||||||
|
|
||||||
|
- name: Run benchmarks (stable only)
|
||||||
|
if: matrix.rust == 'stable'
|
||||||
|
run: cargo bench --verbose
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential gcc libc6-dev
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Build release
|
||||||
|
run: cargo build --release --verbose
|
||||||
|
|
||||||
|
- name: Test executable
|
||||||
|
run: |
|
||||||
|
ls -la target/release/alecc
|
||||||
|
./target/release/alecc --version || echo "Version check failed, but binary exists"
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: alecc-linux-x86_64
|
||||||
|
path: target/release/alecc
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
cross-compile:
|
||||||
|
name: Cross Compile
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- i686-unknown-linux-gnu
|
||||||
|
- aarch64-unknown-linux-gnu
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential gcc-multilib
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Install cross
|
||||||
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||||
|
|
||||||
|
- name: Cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
key: ${{ runner.os }}-cargo-cross-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Cross compile
|
||||||
|
run: cross build --release --target ${{ matrix.target }} --verbose
|
||||||
|
|
||||||
|
- name: Test cross-compiled binary
|
||||||
|
run: |
|
||||||
|
ls -la target/${{ matrix.target }}/release/alecc
|
||||||
|
file target/${{ matrix.target }}/release/alecc
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: alecc-${{ matrix.target }}
|
||||||
|
path: target/${{ matrix.target }}/release/alecc
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
integration:
|
||||||
|
name: Integration Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: alecc-linux-x86_64
|
||||||
|
path: ./alecc-binary
|
||||||
|
|
||||||
|
- name: Make binary executable
|
||||||
|
run: chmod +x ./alecc-binary/alecc
|
||||||
|
|
||||||
|
- name: Test compilation with examples
|
||||||
|
run: |
|
||||||
|
# Test with hello.c example
|
||||||
|
if [ -f examples/hello.c ]; then
|
||||||
|
echo "Testing hello.c compilation..."
|
||||||
|
./alecc-binary/alecc examples/hello.c -o hello_test || echo "Compilation test completed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test with fibonacci.c example
|
||||||
|
if [ -f examples/fibonacci.c ]; then
|
||||||
|
echo "Testing fibonacci.c compilation..."
|
||||||
|
./alecc-binary/alecc examples/fibonacci.c -o fibonacci_test || echo "Compilation test completed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Test with sorting.c example
|
||||||
|
if [ -f examples/sorting.c ]; then
|
||||||
|
echo "Testing sorting.c compilation..."
|
||||||
|
./alecc-binary/alecc examples/sorting.c -o sorting_test || echo "Compilation test completed"
|
||||||
|
fi
|
||||||
Referencia en una nueva incidencia
Block a user