Skip to content

Commit

Permalink
Run CI tests if only there is a change (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
hateofhades authored Nov 2, 2024
1 parent 41e3a7a commit df6bc72
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'src-tauri/**'
- '.github/workflows/**'
- uses: actions/setup-node@v4
if: steps.changes.outputs.src == 'true'
with:
node-version: 20

- name: "Install Dependencies"
if: steps.changes.outputs.src == 'true'
run: |
sudo apt-get update
sudo apt-get install libwebkit2gtk-4.1-dev \
Expand All @@ -42,14 +52,17 @@ jobs:
yarn build
- name: Configure sccache env var
if: steps.changes.outputs.src == 'true'
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: Run sccache-cache
if: steps.changes.outputs.src == 'true'
uses: mozilla-actions/[email protected]

- name: "Lint"
if: steps.changes.outputs.src == 'true'
run: |
cd src-tauri
cargo clippy --all-features --workspace -- -D warnings
Expand All @@ -64,11 +77,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'src-tauri/**'
- '.github/workflows/**'
- uses: actions/setup-node@v4
if: steps.changes.outputs.src == 'true'
with:
node-version: 20

- name: "Install Dependencies"
if: steps.changes.outputs.src == 'true'
run: |
sudo apt-get update
sudo apt-get install libwebkit2gtk-4.1-dev \
Expand All @@ -89,21 +112,26 @@ jobs:
yarn build
- name: Configure sccache env var
if: steps.changes.outputs.src == 'true'
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: Run sccache-cache
if: steps.changes.outputs.src == 'true'
uses: mozilla-actions/[email protected]

- name: Install cargo-llvm-cov
if: steps.changes.outputs.src == 'true'
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
if: steps.changes.outputs.src == 'true'
working-directory: src-tauri
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

- name: Upload coverage to Codecov
if: steps.changes.outputs.src == 'true'
uses: codecov/codecov-action@v4
with:
files: lcov.info
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,31 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'src/**'
- '.github/workflows/**'
- 'package.json'
- uses: actions/setup-node@v4
if: steps.changes.outputs.src == 'true'
with:
node-version: 20

- name: "Install Dependencies"
if: steps.changes.outputs.src == 'true'
run: |
npm install --global yarn
yarn
- name: "Lint"
if: steps.changes.outputs.src == 'true'
run: yarn lint

- name: "Build"
if: steps.changes.outputs.src == 'true'
run: yarn build
5 changes: 4 additions & 1 deletion src/components/NavbarComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
</v-list-item>
</template>
<v-spacer />
<v-list-item v-if="isProjectSelected" @click="deleteProject">
<v-list-item
v-if="isProjectSelected"
@click="deleteProject"
>
<v-row>
<v-col cols="3">
<v-icon icon="mdi:mdi-delete" />
Expand Down

0 comments on commit df6bc72

Please sign in to comment.