From 566668d5ed736c9bba1af525dcbe7fd1bac679fb Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 14 Oct 2024 17:08:52 +0300 Subject: [PATCH 1/2] add CI --- .github/dependabot.yml | 11 +++++++ .github/workflows/rust.yml | 59 ++++++++++++++++++++++++++++++++++++++ Cargo.toml | 7 +++++ dsclient/Cargo.toml | 2 +- 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/rust.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..64f9de4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..d7694a9 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,59 @@ +--- +name: Build + +on: + push: + branches: + - "**" + pull_request: + branches: + - master + schedule: + - cron: '30 13 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + strategy: + matrix: + os: + - ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build + working-directory: "." + shell: bash + run: | + function log + { + declare -rAi TAG=( + [error]=31 + [info]=32 + [audit]=33 + ) + printf '%(%y-%m-%d_%T)T\x1b[%dm\t%s:\t%b\x1b[0m\n' -1 "${TAG[${1,,:?}]}" "${1^^}" "${2:?}" 1>&2 + if [[ ${1} == 'error' ]]; then + return 1 + fi + } + export -f log + if [[ ${RUNNER_OS} == "Linux" ]]; then + log 'info' 'Download dep' + sudo apt-get update + sudo apt-get install -y ninja-build lib{x11,xext,xft,xinerama,xcursor,xrender,xfixes,pango1.0,gl1-mesa,glu1-mesa,xdo}-dev + log 'info' 'Cargo Clippy' + cargo clippy --quiet + log 'info' 'Cargo Build' + cargo build --quiet --release + fi > /dev/null + - name: Archive + uses: actions/upload-artifact@v4 + with: + retention-days: 1 + path: target/release/* diff --git a/Cargo.toml b/Cargo.toml index aa729a5..518c431 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,14 @@ [workspace] +resolver = "2" members = [ "dscom", "dsserver", "dsclient" ] + +[profile.release] +strip = true +opt-level = "z" +lto = true +panic = "abort" diff --git a/dsclient/Cargo.toml b/dsclient/Cargo.toml index 66abb2b..b55e010 100644 --- a/dsclient/Cargo.toml +++ b/dsclient/Cargo.toml @@ -15,5 +15,5 @@ panic = "abort" dscom = {path = "../dscom"} flate2 = "1.0" -fltk = { version = "^1.3", git = "https://github.com/fltk-rs/fltk-rs" } +fltk = { version = "1.4.34", features = ["use-ninja"] } rayon = "1.5" From 94bcd568b1e437b536171fc454e38c56d27a1fbc Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 14 Oct 2024 17:13:45 +0300 Subject: [PATCH 2/2] fix CI --- .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 d7694a9..d8dae8a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -46,7 +46,7 @@ jobs: if [[ ${RUNNER_OS} == "Linux" ]]; then log 'info' 'Download dep' sudo apt-get update - sudo apt-get install -y ninja-build lib{x11,xext,xft,xinerama,xcursor,xrender,xfixes,pango1.0,gl1-mesa,glu1-mesa,xdo}-dev + sudo apt-get install -y ninja-build lib{x11,xext,xft,xinerama,xcursor,xrender,xfixes,pango1.0,gl1-mesa,glu1-mesa,xdo,xcb-randr0}-dev log 'info' 'Cargo Clippy' cargo clippy --quiet log 'info' 'Cargo Build'