From 9a3e8ce031de2d9c974bae2560ba87b86b424a73 Mon Sep 17 00:00:00 2001 From: Kreyren Date: Mon, 10 Feb 2020 17:41:28 +0000 Subject: [PATCH] sagsag --- .github/workflows/python.yml | 51 +--------------- .github/workflows/rustlang.yml | 78 +++++++++++++++---------- Cargo.toml | 6 +- benches/{rustlang => }/example_bench.rs | 6 ++ 4 files changed, 57 insertions(+), 84 deletions(-) rename benches/{rustlang => }/example_bench.rs (74%) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 71bbcec..bd09c2d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -36,53 +36,4 @@ jobs: - name: Test with pytest run: | pip install pytest - for file in $(git --no-pager diff --name-only origin/master | grep -o ".*\.py") ;do pytest "$file";done - # Kernel specific builds - build-python: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, windows-latest] - steps: - - uses: actions/checkout@v2 - - name: building.. - run: make build-python - - # Docker builds - build-python-debian: - runs-on: ubuntu-latest - steps: - - uses: docker://debian/testing:latest - - uses: actions/checkout@v2 - - name: building.. - run: make build-python - - build-python-fedora: - runs-on: ubuntu-latest - steps: - - uses: docker://fedora/latest:latest - - uses: actions/checkout@v2 - - name: building.. - run: make build-python - - # Run tests - check-python: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - name: running tests.. - run: make check-python - - # Benchmarks - bench-python: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - steps: - - uses: actions/checkout@v2 - - name: running benchmarks.. - run: make bench-python \ No newline at end of file + for file in $(git --no-pager diff --name-only origin/master | grep -o ".*\.py") ;do pytest "$file";done \ No newline at end of file diff --git a/.github/workflows/rustlang.yml b/.github/workflows/rustlang.yml index 19413e5..fcc9541 100644 --- a/.github/workflows/rustlang.yml +++ b/.github/workflows/rustlang.yml @@ -6,55 +6,71 @@ on: pull_request: types: [synchronize, opened, reopened, ready_for_review] paths: - - '**.rs' + - - "${{ secrets.GITHUB_WORKSPACE }}/*.\\.rs" jobs: # Kernel specific builds - build-rustlang: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, windows-latest] + ubuntu-build: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: building.. - run: make build-rustlang + - name: Building.. + run: cargo build + macos-build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Building.. + run: cargo build + windows-build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Building.. + run: cargo build # Docker builds - build-rustlang-debian: + debian-build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 - uses: docker://debian/testing:latest - - uses: actions/checkout@v2 - - name: building.. - run: make build-rustlang - - build-rustlang-fedora: + - name: Building.. + run: cargo build + fedora-build: runs-on: ubuntu-latest steps: - - uses: docker://fedora/latest:latest - uses: actions/checkout@v2 - - name: building.. - run: make build-rustlang + - uses: docker://fedora/latest:latest + - name: Building.. + run: cargo build + archlinux-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker://archlinux/latest:latest + - name: Building.. + run: cargo build + gentoo-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker://gentoo/stage3-amd64:latest + - name: Building.. + run: cargo build # Run tests - check-rustlang: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + check: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: running tests.. - run: make check-rustlang + - name: Testing.. + run: cargo test # Benchmarks - bench-rustlang: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + bench: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: running benchmarks.. - run: make bench-rustlang \ No newline at end of file + - name: Benchmarking.. + run: cargo bench \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 4980e6b..50bc424 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,6 @@ zernit-logger = { path = "src/libs/rustlang/zernit-logger" } # Used for benchmarking criterion = "0.3.1" -# [[bench]] -# name = "example_bench" -# harness = false \ No newline at end of file +[[bench]] +name = "example_bench" +harness = false \ No newline at end of file diff --git a/benches/rustlang/example_bench.rs b/benches/example_bench.rs similarity index 74% rename from benches/rustlang/example_bench.rs rename to benches/example_bench.rs index 81516fb..8c6c2c7 100644 --- a/benches/rustlang/example_bench.rs +++ b/benches/example_bench.rs @@ -1,5 +1,11 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; +/* + This is base benchmark made for consistency + + FIXME-BENCH: Make cargo to recognize `benches/rustlang` path instead of `benches/` +*/ + fn fibonacci(n: u64) -> u64 { match n { 0 => 1,