diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1129b04..d869f1f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,12 +33,15 @@ jobs: - name: Build run: cargo build --verbose + - name: Build NPM (formatting) + run: npm ci + - name: Execute tests run: cargo test --all-features env: - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Cinstrument-coverage' - LLVM_PROFILE_FILE: 'target/coverage/%p-%m.profraw' + CARGO_INCREMENTAL: "0" + RUSTFLAGS: "-Cinstrument-coverage" + LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw" - name: Generate coverage report run: | @@ -58,13 +61,20 @@ jobs: git add -A git diff --cached --exit-code - - name: Format code + - name: Format rust code if: >- ${{ !contains(env.lastcommit, '🎨 Formatted code') }} run: cargo fmt + - name: Format other code + if: >- + ${{ + !contains(env.lastcommit, '🎨 Formatted code') + }} + run: npm run format + - name: Add formatting-commit if: >- ${{ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ca8001..154076e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,16 @@ on: workflow_dispatch: inputs: version: - description: 'Version (SemVer)' + description: "Version (SemVer)" required: true default: 0.0.0 deployment-aur-gui: - description: 'Deployment (AUR, GUI)' + description: "Deployment (AUR, GUI)" type: boolean required: true default: true deployment-aur-cli: - description: 'Deployment (AUR, CLI)' + description: "Deployment (AUR, CLI)" type: boolean required: true default: true @@ -94,16 +94,16 @@ jobs: run: | VERSION=${{ github.event.inputs.version }} sha=$(sha256sum tiny4linux-${VERSION}.tar.gz | cut -d' ' -f1) - + cd deployment/gui/aur - + sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD sed -i "s/^sha256sums=.*/sha256sums=('${sha}')/" PKGBUILD - + # Write-Permissions for Container-User chmod -R 777 . - + docker run --rm -v $PWD:/pkg archlinux:latest bash -c " pacman -Sy --noconfirm --needed base-devel shadow && useradd -m builder || true && @@ -117,16 +117,16 @@ jobs: run: | VERSION=${{ github.event.inputs.version }} sha=$(sha256sum tiny4linux-${VERSION}.tar.gz | cut -d' ' -f1) - + cd deployment/cli/aur - + sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD sed -i "s/^sha256sums=.*/sha256sums=('${sha}')/" PKGBUILD - + # Write-Permissions for Container-User chmod -R 777 . - + docker run --rm -v $PWD:/pkg archlinux:latest bash -c " pacman -Sy --noconfirm --needed base-devel shadow && useradd -m builder || true && @@ -179,7 +179,7 @@ jobs: git push -u origin HEAD:main --tags create-github-release: - name: 'Create GitHub release' + name: "Create GitHub release" runs-on: ubuntu-latest needs: [build, update-metadata, add-version-commit] steps: @@ -207,7 +207,7 @@ jobs: tiny4linux-${{ github.event.inputs.version }}.zip deploy-aur-gui: - name: 'Deploy GUI to AUR' + name: "Deploy GUI to AUR" runs-on: ubuntu-latest if: ${{ github.event.inputs.deployment-aur-gui == 'true' }} needs: [create-github-release] @@ -237,10 +237,10 @@ jobs: git config user.email "openfoxes@bono-fox.de" git add PKGBUILD .SRCINFO LICENSE git commit -m "Update to Version ${{ github.event.inputs.version }}" - git push + git push deploy-aur-cli: - name: 'Deploy CLI to AUR' + name: "Deploy CLI to AUR" runs-on: ubuntu-latest if: ${{ github.event.inputs.deployment-aur-cli == 'true' }} needs: [create-github-release] @@ -270,7 +270,7 @@ jobs: git config user.email "openfoxes@bono-fox.de" git add PKGBUILD .SRCINFO LICENSE git commit -m "Update to Version ${{ github.event.inputs.version }}" - git push + git push cleanup: name: Cleanup diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63b915d..73d342b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,9 +17,9 @@ jobs: - name: Execute tests run: cargo test --all-features env: - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Cinstrument-coverage' - LLVM_PROFILE_FILE: 'target/coverage/%p-%m.profraw' + CARGO_INCREMENTAL: "0" + RUSTFLAGS: "-Cinstrument-coverage" + LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw" - name: Generate coverage report run: | diff --git a/.gitignore b/.gitignore index 660bfe1..ebc906b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # SPDX-License-Identifier: EUPL-1.2 /target +/node_modules tiny4linux-*.tar.gz tiny4linux-*.zip diff --git a/.idea/runConfigurations/Format_All.xml b/.idea/runConfigurations/Format_All.xml new file mode 100644 index 0000000..362d5ec --- /dev/null +++ b/.idea/runConfigurations/Format_All.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Format_Others.xml b/.idea/runConfigurations/Format_Others.xml new file mode 100644 index 0000000..23ee335 --- /dev/null +++ b/.idea/runConfigurations/Format_Others.xml @@ -0,0 +1,12 @@ + + + + + +