From 399ae61ad721b22b454b45bd379eb7e93b4f9a9b Mon Sep 17 00:00:00 2001 From: Kyle Scheuing Date: Tue, 17 Oct 2023 03:10:33 -0400 Subject: [PATCH] remove unnecessary stuff for testing --- .github/workflows/build.yml | 89 ------------------------------- .github/workflows/lint.yml | 38 ------------- .github/workflows/test.yml | 89 ------------------------------- .github/workflows/web.yml | 103 ------------------------------------ 4 files changed, 319 deletions(-) delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/web.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81897ef3..d72e2f64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,70 +3,7 @@ name: "build" on: workflow_dispatch: -env: - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - jobs: - build_linux: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: dtolnay/rust-toolchain@stable - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install libdbus-1-dev pkg-config libgtk-4-dev libadwaita-1-dev gettext libfuse2 - - name: Install cargo-make - run: cargo install cargo-make - - name: Install appimage-builder - run: | - curl --location -o appimage-builder https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage - chmod +x appimage-builder - sudo mv appimage-builder /usr/bin/ - - name: Build cli - run: cargo build --release --package openscq30_cli - - name: Build AppImage - working-directory: ./packaging/appimage - run: appimage-builder --skip-tests - - - name: Move to artifacts directory - run: | - mkdir artifacts - mv target/release/openscq30_cli artifacts/openscq30_cli-linux-x86_64 - mv packaging/appimage/openscq30_gui-*.AppImage* artifacts/ - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: linux - path: artifacts/* - - build_macos: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: dtolnay/rust-toolchain@stable - - run: brew install gtk4 libadwaita - - - name: Build gui - run: cargo build --release --package openscq30_gui - - name: Build cli - run: cargo build --release --package openscq30_cli - - name: Move to artifacts directory - run: | - mkdir artifacts - mv target/release/openscq30_cli artifacts/openscq30_cli-macos-x86_64 - mv target/release/openscq30_gui artifacts/openscq30_gui-macos-x86_64 - - name: Upload gui - uses: actions/upload-artifact@v3 - with: - name: macos - path: artifacts/* - build_windows_gui: runs-on: windows-2022 steps: @@ -122,29 +59,3 @@ jobs: with: name: windows-cli path: artifacts/* - - build_android: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: dtolnay/rust-toolchain@stable - with: - targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android - - uses: actions/setup-java@v3 - with: - distribution: temurin # See 'Supported distributions' for available options - java-version: 17 - - name: Install cargo-ndk - run: cargo install cargo-ndk - - name: Build - run: ./gradlew --no-daemon assembleBluetoothRelease - working-directory: android - - name: Rename apk - run: mv android/app/build/outputs/apk/bluetooth/release/app-bluetooth-release-unsigned.apk openscq30_android.apk - - name: Upload apk - uses: actions/upload-artifact@v3 - with: - name: android - path: openscq30_android.apk diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 4c5532d1..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: "lint" - -on: - - push - -env: - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - -jobs: - rustfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install rust - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: Install cargo-make - uses: davidB/rust-cargo-make@v1 - - name: Check formatting - run: cargo make fmt-check - - ktlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: actions/setup-java@v3 - with: - distribution: temurin # See 'Supported distributions' for available options - java-version: 17 - - name: Run ktlint - run: | - cd android - ./gradlew ktlintCheck diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index bff5b7ee..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: "test" - -on: - - push - -env: - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - -jobs: - rust_test_linux: - runs-on: ubuntu-latest - container: - image: ubuntu:23.10 - steps: - - name: Install basic requirements - run: | - apt-get update - apt-get install -y git curl unzip - - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install dependencies from apt - run: | - apt-get install -y libdbus-1-dev pkg-config libgtk-4-dev libadwaita-1-dev - - name: Install display server - run: | - apt-get install -y xvfb - - name: Install rust - uses: dtolnay/rust-toolchain@stable - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Install cargo-make - uses: davidB/rust-cargo-make@v1 - - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 - - name: Run rust tests - run: xvfb-run --auto-servernum cargo make test-cov - - name: Generate HTML test coverage report - run: cargo make test-cov-report-html - - name: Upload coverage report - uses: actions/upload-artifact@v3 - with: - name: coverage - path: target/llvm-cov/html/ - - # Only lib is tested on windows since building gtk takes too long, and lib is the only crate with os specific code - rust_test_windows: - runs-on: windows-2022 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install rust - uses: dtolnay/rust-toolchain@stable - - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 - - name: Install cargo-make - uses: davidB/rust-cargo-make@v1 - - name: Run rust tests - run: cargo make integration-test - - android_test: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install rust - uses: dtolnay/rust-toolchain@stable - with: - targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android - - uses: actions/setup-java@v3 - with: - distribution: temurin # See 'Supported distributions' for available options - java-version: 17 - - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 - - name: Install cargo-ndk - run: cargo install cargo-ndk - - - name: Run android unit tests - uses: gradle/gradle-build-action@v2 - with: - arguments: testBluetoothDebugUnitTest - build-root-directory: android - # - name: Run android instrumented tests - # working-directory: android - # run: ./gradlew connectedAndroidTest diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml deleted file mode 100644 index ccef2d7d..00000000 --- a/.github/workflows/web.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: "Web" - -on: - - push - -env: - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - -jobs: - unit_test: - runs-on: ubuntu-latest - defaults: - run: - working-directory: web - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install rust - uses: dtolnay/rust-toolchain@stable - - name: Install node - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 - - name: Install dependencies - run: npm ci - - name: Build wasm only - run: npm run build:wasm - - name: Run tests - run: npm run test - - e2e_test: - runs-on: ubuntu-latest - defaults: - run: - working-directory: web - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install rust - uses: dtolnay/rust-toolchain@stable - - name: Install node - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Cache cargo dependencies - uses: Swatinem/rust-cache@v2 - - name: Install dependencies - run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run e2e tests - run: npm run e2etest - - uses: actions/upload-artifact@v3 - with: - name: playwright-report - path: web/playwright-report/ - - deploy_to_pages: - runs-on: ubuntu-latest - needs: ["unit_test", "e2e_test"] - if: startsWith(github.ref, 'refs/tags/v') - # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages - permissions: - contents: read - pages: write - id-token: write - defaults: - run: - working-directory: web - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install rust - uses: dtolnay/rust-toolchain@stable - - name: Install node - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install wasm-pack - run: cargo install wasm-pack - - name: Install dependencies - run: npm ci - - name: Build - run: npm run build - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - # Upload entire repository - path: web/dist/ - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2