From b6665c459c2bb32ff180fbcc732ef5987d2d263d Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:06:23 +0200 Subject: [PATCH 01/17] chore: Add tarpaulin and releaser --- .github/workflows/release.yml | 15 +++++++++++++++ .github/workflows/rust.yml | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..937ee41 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +on: + release: + types: [created] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + EXTRA_FILES: "README.md LICENSE" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 31000a2..f69e0b0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,6 +16,23 @@ jobs: steps: - uses: actions/checkout@v3 + - name: nightly-rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt, clippy + - name: run code coverage + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.15.0' + args: '-- --engine llvm --test-threads 1' + - name: upload code coverage + uses: actions/upload-artifact@v1 + with: + name: code-coverage-report + path: code-coverage-report.xml + - name: Build run: cargo build --verbose - name: Run tests From dffca90c54210807db816958a8f3b746d93d0091 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:08:29 +0200 Subject: [PATCH 02/17] chore: Update branch rules --- .github/workflows/rust.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f69e0b0..fc64184 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,7 +2,6 @@ name: Rust on: push: - branches: [ "main" ] pull_request: branches: [ "main" ] From 79dbd48b811f38303c7d215bfa2112e53e3367f5 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:10:27 +0200 Subject: [PATCH 03/17] chore: Fix unknown CI/CD parameter --- .github/workflows/rust.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fc64184..34e92b4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,12 +20,11 @@ jobs: with: profile: minimal toolchain: nightly - components: rustfmt, clippy - name: run code coverage uses: actions-rs/tarpaulin@v0.1 with: version: '0.15.0' - args: '-- --engine llvm --test-threads 1' + args: '-- --test-threads 1' - name: upload code coverage uses: actions/upload-artifact@v1 with: From 3cc002ef0318290e3dfe26329ca8c8d5dd47a247 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:29:45 +0200 Subject: [PATCH 04/17] chore: Use toml as coverage report file --- .github/workflows/rust.yml | 3 ++- coverage/coverage.toml | 0 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 coverage/coverage.toml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 34e92b4..1dc294d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,11 +25,12 @@ jobs: with: version: '0.15.0' args: '-- --test-threads 1' + out-type: "Toml" - name: upload code coverage uses: actions/upload-artifact@v1 with: name: code-coverage-report - path: code-coverage-report.xml + path: coverage/coverage.toml - name: Build run: cargo build --verbose diff --git a/coverage/coverage.toml b/coverage/coverage.toml new file mode 100644 index 0000000..e69de29 From e88b61877db70ff54e732e716e70a5d95c0970c0 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:31:45 +0200 Subject: [PATCH 05/17] chore: Toml is not supported, use xml instead --- .github/workflows/rust.yml | 3 +-- coverage/{coverage.toml => coverage.xml} | 0 2 files changed, 1 insertion(+), 2 deletions(-) rename coverage/{coverage.toml => coverage.xml} (100%) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1dc294d..1c5bef0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,12 +25,11 @@ jobs: with: version: '0.15.0' args: '-- --test-threads 1' - out-type: "Toml" - name: upload code coverage uses: actions/upload-artifact@v1 with: name: code-coverage-report - path: coverage/coverage.toml + path: coverage/coverage.xml - name: Build run: cargo build --verbose diff --git a/coverage/coverage.toml b/coverage/coverage.xml similarity index 100% rename from coverage/coverage.toml rename to coverage/coverage.xml From 09e01ae830e6815aa677ad57123d149f5e1b7cf0 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:43:37 +0200 Subject: [PATCH 06/17] chore: Change file name to tarpaulin default --- .github/workflows/rust.yml | 2 +- coverage/coverage.xml | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 coverage/coverage.xml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1c5bef0..9595aae 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -29,7 +29,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: code-coverage-report - path: coverage/coverage.xml + path: cobertura.xml - name: Build run: cargo build --verbose diff --git a/coverage/coverage.xml b/coverage/coverage.xml deleted file mode 100644 index e69de29..0000000 From dc28549ef62f505eb3db17baf1fffd8a57fd9956 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 11:56:17 +0200 Subject: [PATCH 07/17] chore: Use linux-gnu as target triple --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 937ee41..d4c5ead 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,4 +12,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + RUSTTARGET: x86_64_unknown_linux_gnu EXTRA_FILES: "README.md LICENSE" From 7115056ae686119e99496beddd1060b31c372123 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 12:01:00 +0200 Subject: [PATCH 08/17] chore: Use target matrix --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4c5ead..97db579 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: jobs: release: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: [x86_64-unknown-linux-gnu] steps: - uses: actions/checkout@master - name: Compile and release @@ -12,5 +16,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - RUSTTARGET: x86_64_unknown_linux_gnu + RUSTTARGET: ${{ matrix.target }} EXTRA_FILES: "README.md LICENSE" From 96925818c85c2cb38b90c1e7e791282a4d573b99 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 12:04:14 +0200 Subject: [PATCH 09/17] chore: Use musl as gnu is not supported? --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97db579..df34a51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - target: [x86_64-unknown-linux-gnu] + target: [x86_64-unknown-linux-musl] steps: - uses: actions/checkout@master - name: Compile and release From f0a7d846d4547a8f35c97148b8e73588aa598412 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 16:34:58 +0200 Subject: [PATCH 10/17] chore: use action-gh-releaser --- .github/workflows/release.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df34a51..e60d6a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,16 +5,18 @@ on: jobs: release: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [x86_64-unknown-linux-musl] steps: - - uses: actions/checkout@master - - name: Compile and release - uses: rust-build/rust-build.action@v1.4.3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + - name: nightly-rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - name: Build + run: cargo build --verbose + - name: Upload + uses: actions/upload-artifact@v3 with: - RUSTTARGET: ${{ matrix.target }} - EXTRA_FILES: "README.md LICENSE" + name: reset + path: target/release/reset + From 95263f0baa47c107a294a4734c76aa79a401c7ed Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 16:35:02 +0200 Subject: [PATCH 11/17] chore: use action-gh-releaser --- .github/workflows/release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e60d6a0..5ba39ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,8 @@ jobs: toolchain: nightly - name: Build run: cargo build --verbose - - name: Upload - uses: actions/upload-artifact@v3 + - name: Release + uses: softprops/action-gh-release@v1 with: - name: reset - path: target/release/reset - + files: | + target/release/reset From 55642c7c63a158f5e247701b6efbbbbf560b2c73 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 16:39:19 +0200 Subject: [PATCH 12/17] chore: Use release version of cargo build --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ba39ec..07c29f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: profile: minimal toolchain: nightly - name: Build - run: cargo build --verbose + run: cargo build --release --verbose - name: Release uses: softprops/action-gh-release@v1 with: From ac843068031270481228796f03768af36dea61d6 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Mon, 18 Sep 2023 16:43:48 +0200 Subject: [PATCH 13/17] chore: Change name to snakecase --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cd176f2..d98769c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ReSet" +name = "reset" version = "0.1.0" edition = "2021" From a59a4c7454523593ea74ad348b6562ced85ceff3 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Tue, 19 Sep 2023 07:09:28 +0200 Subject: [PATCH 14/17] chore: Use cache with CI/CD --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9595aae..27d75fa 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,6 +20,11 @@ jobs: with: profile: minimal toolchain: nightly + - name: Cache + uses: actions/cache@v3 + with: + path: cache + key: ${{ runner.os }}-cache - name: run code coverage uses: actions-rs/tarpaulin@v0.1 with: From 733a37303632bc8bd00638105d5765d92dbb6b72 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Tue, 19 Sep 2023 07:11:25 +0200 Subject: [PATCH 15/17] chore: Test commit to check cache --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30209ff..e4960e3 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# ReSet \ No newline at end of file +# ReSet + +A wip universal Linux settings application. From 96d410fb8b79011972b2b27c6057cf2c2f94576f Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Tue, 19 Sep 2023 07:14:08 +0200 Subject: [PATCH 16/17] chore: Try to cache debug folder --- .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 27d75fa..cc6ac46 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,7 +23,7 @@ jobs: - name: Cache uses: actions/cache@v3 with: - path: cache + path: target/debug key: ${{ runner.os }}-cache - name: run code coverage uses: actions-rs/tarpaulin@v0.1 From 808f6f76d9c8d848d9e680e4b82e73cb9ca41c2e Mon Sep 17 00:00:00 2001 From: Fabio Lenherr Date: Tue, 19 Sep 2023 07:15:59 +0200 Subject: [PATCH 17/17] chore: Test commit to check cache --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index d98769c..e9bda64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,5 +2,6 @@ name = "reset" version = "0.1.0" edition = "2021" +description = "A wip universal Linux settings application." [dependencies]