|
name: CI |
|
|
|
on: |
|
push: |
|
branches: [main] |
|
pull_request: |
|
|
|
jobs: |
|
hackerc-tests: |
|
name: hackerc (Python) - testy |
|
runs-on: ubuntu-latest |
|
strategy: |
|
matrix: |
|
python-version: ["3.10", "3.11", "3.12"] |
|
steps: |
|
- uses: actions/checkout@v4 |
|
- uses: actions/setup-python@v5 |
|
with: |
|
python-version: ${{ matrix.python-version }} |
|
- name: Zainstaluj hackerc (editable) + pytest |
|
run: | |
|
pip install -e ./hackerc |
|
pip install pytest |
|
- name: pytest |
|
run: pytest hackerc/tests -v |
|
- name: Sanity - transpilacja przykladu hello-world (crate Rust) |
|
run: | |
|
python -m hackerc.cli check examples/hello-world/cmd/main.hcs |
|
python -m hackerc.cli build examples/hello-world/cmd/main.hcs -o /tmp/hw-out |
|
cat /tmp/hw-out/Cargo.toml |
|
test -f /tmp/hw-out/src/main.rs |
|
- uses: dtolnay/rust-toolchain@stable |
|
if: matrix.python-version == '3.12' |
|
- name: KRYTYCZNE - skompiluj i uruchom wygenerowany crate |
|
if: matrix.python-version == '3.12' |
|
run: | |
|
cd /tmp/hw-out |
|
cargo run --release |
|
|
|
virus-build: |
|
name: virus (Rust) - build + testy + clippy |
|
runs-on: ${{ matrix.os }} |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
os: [ubuntu-latest, macos-latest, windows-latest] |
|
steps: |
|
- uses: actions/checkout@v4 |
|
- uses: dtolnay/rust-toolchain@stable |
|
with: |
|
components: clippy, rustfmt |
|
- uses: Swatinem/rust-cache@v2 |
|
with: |
|
workspaces: virus |
|
- name: cargo build (workspace) |
|
working-directory: virus |
|
run: cargo build --workspace --all-targets |
|
- name: cargo test (workspace) |
|
working-directory: virus |
|
run: cargo test --workspace |
|
- name: cargo clippy |
|
working-directory: virus |
|
run: cargo clippy --workspace --all-targets -- -D warnings |
|
- name: cargo fmt --check |
|
working-directory: virus |
|
run: cargo fmt --all -- --check |