From 895c04be31a7112d4416b3539d7933301a96b63d Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 15:24:48 +0100 Subject: [PATCH 1/7] Improve CI --- .github/workflows/rust.yml | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 780f4a9..7cdefda 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,25 +10,17 @@ env: CARGO_TERM_COLOR: always jobs: - build: - + clippy_check: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt-get install build-essential libgtk-3-dev - sudo apt-get install librust-atk-dev - sudo apt-get install libhdf5-serial-dev - rustup component add clippy - - name: Check package & dependencies for errors - run: cargo check - - name: Lint - run: | - cargo fmt -- --check - cargo clippy -- -D warnings - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v3 + - name: Check package & dependencies for errors + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt, clippy + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From 6ed8f958c5c64c3c8c3fdf0d07649e6d053996ff Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 15:32:36 +0100 Subject: [PATCH 2/7] Fix --- .github/workflows/rust.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7cdefda..ff602e7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,7 +20,26 @@ jobs: profile: minimal toolchain: stable components: rustfmt, clippy - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: + check + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test From 5769d735e2ba2249d20647140bfb950fbed89daa Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 15:38:31 +0100 Subject: [PATCH 3/7] Fix --- .github/workflows/release.yml | 34 ---------------------------------- .github/workflows/rust.yml | 3 ++- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 97469fc..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -# .github/workflows/release.yml - -on: - release: - types: [created] - -jobs: - release: - name: release ${{ matrix.target }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-pc-windows-gnu - archive: zip - - target: x86_64-unknown-linux-musl - archive: tar.gz tar.xz tar.zst - - target: x86_64-apple-darwin - archive: zip - steps: - - uses: actions/checkout@master - - name: Install dependencies - run: | - sudo apt-get install build-essential libgtk-3-dev - sudo apt-get install librust-atk-dev - sudo apt-get install libhdf5-serial-dev - - name: Compile and release - uses: rust-build/rust-build.action@v1.4.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - RUSTTARGET: ${{ matrix.target }} - ARCHIVE_TYPES: ${{ matrix.archive }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ff602e7..33c5bb2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,7 +10,7 @@ env: CARGO_TERM_COLOR: always jobs: - clippy_check: + cargo_checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -19,6 +19,7 @@ jobs: with: profile: minimal toolchain: stable + override: true components: rustfmt, clippy - name: Run cargo check uses: actions-rs/cargo@v1 From a7af7477f8ffefab9191b8907cbaa28fc3bee96e Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 15:56:00 +0100 Subject: [PATCH 4/7] Fix --- .github/workflows/rust.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 33c5bb2..2d28000 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,13 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Install dependencies + run: sudo apt-get install -y librust-atk-dev - name: Check package & dependencies for errors uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable - override: true - components: rustfmt, clippy - name: Run cargo check uses: actions-rs/cargo@v1 with: @@ -35,11 +35,6 @@ jobs: with: command: clippy args: -- -D warnings - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: - check - name: Run cargo test uses: actions-rs/cargo@v1 with: From a08a149f45a886a22c7f2a59274a64b6149cbde7 Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 16:11:26 +0100 Subject: [PATCH 5/7] Install gtk --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2d28000..090573b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install dependencies - run: sudo apt-get install -y librust-atk-dev + run: sudo apt-get install -y librust-atk-dev libgtk-3-dev - name: Check package & dependencies for errors uses: actions-rs/toolchain@v1 with: From a01fa65f7b0e26fc7768c25d14862a640f65c098 Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 16:17:13 +0100 Subject: [PATCH 6/7] Install HDF5 --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 090573b..031aa2b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install dependencies - run: sudo apt-get install -y librust-atk-dev libgtk-3-dev + run: sudo apt-get install -y librust-atk-dev libgtk-3-dev libhdf5-serial-dev - name: Check package & dependencies for errors uses: actions-rs/toolchain@v1 with: From 6515bca4bbc8271664788f8474d5a380cb09fa99 Mon Sep 17 00:00:00 2001 From: Adrien Berchet Date: Fri, 2 Dec 2022 16:26:32 +0100 Subject: [PATCH 7/7] Split into several jobs --- .github/workflows/rust.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 031aa2b..daafb0a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,6 +25,17 @@ jobs: uses: actions-rs/cargo@v1 with: command: check + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: sudo apt-get install -y librust-atk-dev libgtk-3-dev libhdf5-serial-dev + - name: Check package & dependencies for errors + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable - name: Run cargo fmt uses: actions-rs/cargo@v1 with: @@ -35,6 +46,18 @@ jobs: with: command: clippy args: -- -D warnings + + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: sudo apt-get install -y librust-atk-dev libgtk-3-dev libhdf5-serial-dev + - name: Check package & dependencies for errors + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable - name: Run cargo test uses: actions-rs/cargo@v1 with: