Skip to content

Commit

Permalink
Update CI (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn authored Aug 2, 2023
1 parent 83f6993 commit da194db
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 221 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
manylinux: auto
Expand All @@ -32,8 +30,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: aarch64-unknown-linux-gnu
Expand All @@ -51,8 +47,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: armv7
Expand All @@ -70,8 +64,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: x86_64
Expand All @@ -89,8 +81,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: aarch64
Expand All @@ -108,8 +98,6 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
command: build
Expand All @@ -125,8 +113,6 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
command: build
Expand All @@ -141,7 +127,7 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
if: github.event_name == 'release' && github.event.action == 'published'
needs:
[
macos,
Expand Down
34 changes: 3 additions & 31 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly

- name: Cache Rust
uses: Swatinem/rust-cache@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "requirements_dev.txt"

- name: Create virtual environment
run: |
python -m venv venv
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: "Test Rust"
if: matrix.os == 'ubuntu-latest'
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo test
- name: Install tzfpy and test(Windows)
Expand All @@ -70,7 +53,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
maturin develop --release --extras=pytz
pytest --cov --cov-report xml | tee benchmark_result.txt
pytest | tee benchmark_result.txt
- name: Install tzfpy and test(Ubuntu&macoS)
if: matrix.os != 'windows-latest'
Expand All @@ -80,19 +63,8 @@ jobs:
pip install --upgrade pip
pip install -r requirements_dev.txt
maturin develop --release --extras=pytz
pytest --cov --cov-report xml | tee benchmark_result.txt
pytest | tee benchmark_result.txt
- name: Postprocessing cov
if: matrix.os == 'ubuntu-latest'
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo llvm-cov --no-run --lcov --output-path coverage.lcov
- uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest'
with:
files: coverage.lcov,coverage.xml
name: ${{ matrix.os }}
- name: Setup benchmark file name
id: gen-benchmark-file-name
Expand Down
Loading

0 comments on commit da194db

Please sign in to comment.