build: Run tests on pushes to non-main branches

This commit is contained in:
SinTan1729
2025-10-15 00:07:35 -05:00
parent 7e43ea4bef
commit 401bf1124a
3 changed files with 36 additions and 36 deletions

35
.github/workflows/rust-tests.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Tests
on:
push:
branches: ["*"]
paths: ["actix/**"]
pull_request:
branches: ["main"]
paths: ["actix/**"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./actix
steps:
- uses: actions/checkout@v4
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
actix/target
actix/.cargo
key: cargo-${{ runner.os }}-${{ hashFiles('actix/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-
- name: Build
run: cargo build
- name: Run tests
run: cargo test

View File

@@ -1,35 +0,0 @@
name: Tests
on:
push:
branches: [ "main" ]
paths: [ "actix/**" ]
pull_request:
branches: [ "main" ]
paths: [ "actix/**" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./actix
steps:
- uses: actions/checkout@v4
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
actix/target
actix/.cargo
key: cargo-${{ runner.os }}-${{ hashFiles('actix/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-
- name: Build
run: cargo build
- name: Run tests
run: cargo test

View File

@@ -1,7 +1,7 @@
<!-- SPDX-FileCopyrightText: 2023 Sayantan Santra <sayantan.santra689@gmail.com> -->
<!-- SPDX-License-Identifier: MIT -->
[![github-tests-badge](https://github.com/SinTan1729/chhoto-url/actions/workflows/rust_tests.yml/badge.svg)](https://github.com/SinTan1729/chhoto-url/actions/workflows/rust_tests.yml)
[![github-tests-badge](https://github.com/SinTan1729/chhoto-url/actions/workflows/rust-tests.yml/badge.svg)](https://github.com/SinTan1729/chhoto-url/actions/workflows/rust-tests.yml)
[![docker-pulls-badge](https://img.shields.io/docker/pulls/sintan1729/chhoto-url)](https://hub.docker.com/r/sintan1729/chhoto-url)
[![maintainer-badge](https://img.shields.io/badge/maintainer-SinTan1729-blue)](https://github.com/SinTan1729)
[![latest-release-badge](https://img.shields.io/github/v/release/SinTan1729/chhoto-url?label=latest%20release)](https://github.com/SinTan1729/chhoto-url/releases/latest)