From d8deb3d9bee77683c425567e48f246fa39606859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sch=C3=B6nauer?= <37108907+DottoDev@users.noreply.github.com> Date: Sun, 16 Oct 2022 16:22:21 +0000 Subject: [PATCH 1/6] Delete main.yml --- .github/workflows/main.yml | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index cfec6d82..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: CI - -on: - pull_request: - push: - branches: - - master - -jobs: - build: - strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - fail-fast: false - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.57.0 - profile: minimal - override: true - components: rustfmt, clippy - - uses: actions-rs/cargo@v1.0.1 - name: Check format - with: - command: fmt - args: --all -- --check - - uses: actions-rs/cargo@v1.0.1 - name: Run clippy - with: - command: clippy - args: --all-targets --locked -- -D warnings - - uses: actions-rs/cargo@v1.0.1 - name: Run clippy (All features) - with: - command: clippy - args: --all-targets --locked --all-features -- -D warnings - - uses: actions-rs/cargo@v1.0.1 - name: Run tests - with: - command: test From 0f85107c1962724f5a1bf9f66d498cf39735858f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sch=C3=B6nauer?= <37108907+DottoDev@users.noreply.github.com> Date: Sun, 16 Oct 2022 16:22:44 +0000 Subject: [PATCH 2/6] Delete release.yml --- .github/workflows/release.yml | 73 ----------------------------------- 1 file changed, 73 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 ed30643f..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: CD Native - -on: - release: - types: [ created ] - -jobs: - build: - strategy: - fail-fast: false - matrix: - platform: [ ubuntu-latest, macos-latest, windows-latest ] - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.57.0 - profile: minimal - override: true - components: rustfmt, clippy - - uses: actions-rs/cargo@v1.0.1 - name: Check format - with: - command: fmt - args: --all -- --check - - uses: actions-rs/cargo@v1.0.1 - name: Run clippy - with: - command: clippy - args: --all-targets --locked -- -D warnings - - uses: actions-rs/cargo@v1.0.1 - name: Run clippy (All features) - with: - command: clippy - args: --all-targets --locked --all-features -- -D warnings - - uses: actions-rs/cargo@v1.0.1 - name: Run tests - with: - command: test - - uses: actions-rs/cargo@v1.0.1 - name: Build - with: - command: build - args: --release --all-features - - name: Rename Release (Unix) - run: | - cargo install default-target - mkdir assets - FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) - mv target/release/topgrade assets - cd assets - tar --format=ustar -czf $FILENAME.tar.gz topgrade - rm topgrade - ls . - if: ${{ matrix.platform != 'windows-latest' }} - shell: bash - - name: Rename Release (Windows) - run: | - cargo install default-target - mkdir assets - FILENAME=topgrade-${{github.event.release.tag_name}}-$(default-target) - mv target/release/topgrade.exe assets/topgrade.exe - cd assets - powershell Compress-Archive -Path * -Destination ${FILENAME}.zip - rm topgrade.exe - ls . - if: ${{ matrix.platform == 'windows-latest' }} - shell: bash - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: assets/* From dc5500e094f4807ca5ad6fea2532cff801c42719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sch=C3=B6nauer?= <37108907+DottoDev@users.noreply.github.com> Date: Sun, 16 Oct 2022 16:22:54 +0000 Subject: [PATCH 3/6] Delete release-cross.yml --- .github/workflows/release-cross.yml | 66 ----------------------------- 1 file changed, 66 deletions(-) delete mode 100644 .github/workflows/release-cross.yml diff --git a/.github/workflows/release-cross.yml b/.github/workflows/release-cross.yml deleted file mode 100644 index 7d3d4ef0..00000000 --- a/.github/workflows/release-cross.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: CD Cross - -on: - release: - types: [ created ] - -jobs: - build: - strategy: - fail-fast: false - matrix: - target: [ "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf", "x86_64-unknown-linux-musl" ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.57.0 - profile: minimal - default: true - override: true - target: ${{ matrix.target }} - components: rustfmt, clippy - - uses: actions-rs/cargo@v1.0.1 - name: Check format - with: - use-cross: true - command: fmt - args: --all -- --check - - uses: actions-rs/cargo@v1.0.1 - name: Run clippy - with: - command: clippy - use-cross: true - args: --all-targets --locked --target ${{matrix.target}} -- -D warnings - - uses: actions-rs/cargo@v1.0.1 - name: Run clippy (All features) - with: - command: clippy - use-cross: true - args: --locked --all-features --target ${{matrix.target}} -- -D warnings - - uses: actions-rs/cargo@v1.0.1 - name: Run tests - with: - command: test - use-cross: true - args: --target ${{matrix.target}} - - uses: actions-rs/cargo@v1.0.1 - name: Build - with: - command: build - use-cross: true - args: --release --all-features --target ${{matrix.target}} - - name: Rename Release - run: | - mkdir assets - FILENAME=topgrade-${{github.event.release.tag_name}}-${{matrix.target}} - mv target/${{matrix.target}}/release/topgrade assets - cd assets - tar --format=ustar -czf $FILENAME.tar.gz topgrade - rm topgrade - ls . - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: assets/* From 5d1f3ee8754945ae7f96e828feef5d29a9a500be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sch=C3=B6nauer?= Date: Sun, 16 Oct 2022 19:21:53 +0200 Subject: [PATCH 4/6] Added github workflows --- .github/workflows/check-and-lint.yaml | 55 +++++++++++++++++++++++ .github/workflows/release-packaging.yaml | 27 ++++++++++++ .github/workflows/test.yaml | 56 ++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 .github/workflows/check-and-lint.yaml create mode 100644 .github/workflows/release-packaging.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/check-and-lint.yaml b/.github/workflows/check-and-lint.yaml new file mode 100644 index 00000000..6eb45d48 --- /dev/null +++ b/.github/workflows/check-and-lint.yaml @@ -0,0 +1,55 @@ +on: + pull_request: + push: + branches: + - main + + +name: Check and Lint + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + override: true + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features + name: Clippy Output diff --git a/.github/workflows/release-packaging.yaml b/.github/workflows/release-packaging.yaml new file mode 100644 index 00000000..be382457 --- /dev/null +++ b/.github/workflows/release-packaging.yaml @@ -0,0 +1,27 @@ +on: + push: + branches: + - main + +name: Release Packaging + +jobs: + release: + name: Release Packaging + env: + PROJECT_NAME_UNDERSCORE: rust_ci_github_actions_workflow + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Release Build + run: cargo build --release + - name: 'Upload Artifact' + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROJECT_NAME_UNDERSCORE }} + path: target/release/${{ env.PROJECT_NAME_UNDERSCORE }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..ee09868e --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,56 @@ +on: + pull_request: + push: + branches: + - main + +name: Test with Code Coverage + +jobs: + test: + name: Test + env: + PROJECT_NAME_UNDERSCORE: rust_ci_github_actions_workflow + CARGO_INCREMENTAL: 0 + RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort + RUSTDOCFLAGS: -Cpanic=abort + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - name: Cache dependencies + uses: actions/cache@v2 + env: + cache-name: cache-dependencies + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/bin + ~/.cargo/registry/index + ~/.cargo/registry/cache + target + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} + - name: Generate test result and coverage report + run: | + cargo install cargo2junit grcov; + cargo test $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml; + zip -0 ccov.zip `find . \( -name "$PROJECT_NAME_UNDERSCORE*.gc*" \) -print`; + grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov.info; + - name: Upload test results + uses: EnricoMi/publish-unit-test-result-action@v1 + with: + check_name: Test Results + github_token: ${{ secrets.GITHUB_TOKEN }} + files: results.xml + - name: Upload to CodeCov + uses: codecov/codecov-action@v1 + with: + # required for private repositories: + # token: ${{ secrets.CODECOV_TOKEN }} + files: ./lcov.info + fail_ci_if_error: true From 16566ea69712d3b4c7cbf8b26ff186e4a7bd5818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sch=C3=B6nauer?= Date: Sun, 16 Oct 2022 19:25:46 +0200 Subject: [PATCH 5/6] Changed workflow values --- .github/workflows/release-packaging.yaml | 2 +- .github/workflows/test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-packaging.yaml b/.github/workflows/release-packaging.yaml index be382457..5db6e1ba 100644 --- a/.github/workflows/release-packaging.yaml +++ b/.github/workflows/release-packaging.yaml @@ -9,7 +9,7 @@ jobs: release: name: Release Packaging env: - PROJECT_NAME_UNDERSCORE: rust_ci_github_actions_workflow + PROJECT_NAME_UNDERSCORE: topgrade_rs runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ee09868e..98bfa98a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,7 +10,7 @@ jobs: test: name: Test env: - PROJECT_NAME_UNDERSCORE: rust_ci_github_actions_workflow + PROJECT_NAME_UNDERSCORE: topgrade_rs CARGO_INCREMENTAL: 0 RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort RUSTDOCFLAGS: -Cpanic=abort From ec6da2f18ca3c9eb5bb8d2d558c91ca8e758709b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sch=C3=B6nauer?= Date: Sun, 16 Oct 2022 19:55:08 +0200 Subject: [PATCH 6/6] added Documentation reference in Readme --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f339f966..7337d677 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ ![Topgrade](doc/topgrade.png) - -[![Travis](https://api.travis-ci.org/r-darwish/topgrade.svg?branch=master)](https://travis-ci.org/r-darwish/topgrade) -[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/r-darwish/topgrade?svg=true)](https://ci.appveyor.com/project/r-darwish/topgrade) + +---> ![Demo](doc/screenshot.gif) @@ -23,6 +22,9 @@ The compiled binaries contain a self-upgrading feature. Topgrade requires Rust 1.51 or above. +## Documentation[WIP] +You can visit the documentation at [topgrade-rs.github.io](https://topgrade-rs.github.io/) . + ## Usage Just run `topgrade`. See [the wiki](https://github.com/r-darwish/topgrade/wiki/Step-list) for the list of things Topgrade supports.