Skip to content

Commit

Permalink
ci: checks, lints and test run in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
szattila98 committed Mar 2, 2024
1 parent 637ebd9 commit d4f45da
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 56 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/conventional-commits.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/lints-and-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Lints and tests

on:
push:
branches: ['main']
pull_request:
branches: ['**']
types: [opened, synchronize]
workflow_dispatch:

jobs:
commit-check:
runs-on: ubuntu-latest
name: Check conventional commit compliance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Check commits
uses: cocogitto/cocogitto-action@v3

client-checks:
runs-on: ubuntu-latest
name: Client checks
needs: [commit-check]
steps:
- uses: actions/checkout@v4

- uses: volta-cli/action@v4

- run: yarn install --immutable

- name: Client check
run: yarn check

- name: Client lint
run: yarn lint

- run: yarn playwright install --with-deps

- name: Client test
run: yarn test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

server-checks:
runs-on: ubuntu-latest
name: Server checks
needs: [commit-check]
steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2
with:
shared-key: whooosh-ubuntu-latest
workspaces: src-tauri

- uses: dtolnay/rust-toolchain@stable

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
version: 1.0

- name: Server check
run: cargo check --manifest-path src-tauri/Cargo.toml

- name: Server lint
run: |
cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings
- name: Server test
run: cargo test --manifest-path src-tauri/Cargo.toml
27 changes: 0 additions & 27 deletions .github/workflows/playwright.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
check-name: 'Check conventional commit compliance'
check-name: 'Lints and tests'

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/tauri.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Tauri

on:
push:
branches: ['main']
pull_request:
branches: ['**']
types: [opened, synchronize]
Expand Down
5 changes: 3 additions & 2 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"stylelint-config-recommended-scss",
"stylelint-prettier/recommended"
],
"plugins": ["stylelint-order"],
"plugins": ["stylelint-order", "stylelint-declaration-block-no-ignored-properties"],
"overrides": [
{
"files": ["**/*.svelte"],
Expand All @@ -18,6 +18,7 @@
"scss/at-import-no-partial-leading-underscore": null,
"shorthand-property-no-redundant-values": null,
"no-descending-specificity": null,
"scss/load-no-partial-leading-underscore": null
"scss/load-no-partial-leading-underscore": null,
"plugin/declaration-block-no-ignored-properties": true
}
}
1 change: 0 additions & 1 deletion env.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"stylelint": "^16.2.1",
"stylelint-config-recommended": "14.0.0",
"stylelint-config-recommended-scss": "14.0.0",
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
"stylelint-order": "6.0.4",
"stylelint-prettier": "5.0.0",
"svelte": "^4.2.8",
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4212,6 +4212,15 @@ __metadata:
languageName: node
linkType: hard

"stylelint-declaration-block-no-ignored-properties@npm:2.8.0":
version: 2.8.0
resolution: "stylelint-declaration-block-no-ignored-properties@npm:2.8.0"
peerDependencies:
stylelint: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0
checksum: 10c0/223dfb6a816aafd1be171194f6d78e5641406d9dc4f989e1af2e68accdb25f6b5439dab468cb37541bcba7b9e42fd10b4687e1f117f7bcb3a7ec1378716bc48b
languageName: node
linkType: hard

"stylelint-order@npm:6.0.4":
version: 6.0.4
resolution: "stylelint-order@npm:6.0.4"
Expand Down Expand Up @@ -4702,6 +4711,7 @@ __metadata:
stylelint: "npm:^16.2.1"
stylelint-config-recommended: "npm:14.0.0"
stylelint-config-recommended-scss: "npm:14.0.0"
stylelint-declaration-block-no-ignored-properties: "npm:2.8.0"
stylelint-order: "npm:6.0.4"
stylelint-prettier: "npm:5.0.0"
svelte: "npm:^4.2.8"
Expand Down

0 comments on commit d4f45da

Please sign in to comment.