Skip to content

Commit ee3f750

Browse files
Merge pull request #9 from monikakonieczna/Task-7-Create-Github-Action-To-Run-Tests-Manually-Based-On-The-Group
Task 7: Create Github Action to run tests manually based on the group
2 parents df01337 + ac986a9 commit ee3f750

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Run Tests by Group
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
testGroup:
6+
description: 'Select a test group to filter tests'
7+
required: true
8+
default: 'all'
9+
type: choice
10+
options:
11+
- all
12+
- sanity
13+
- single_character
14+
- all_characters
15+
- multiple_characters
16+
- filter_characters
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: '14' # Adjust based on your project's needs
30+
31+
- name: Install dependencies
32+
run: npm install # Change if you're using another package manager
33+
34+
- name: Run tests with group
35+
run: |
36+
if [ "${{ github.event.inputs.testGroup }}" == "all" ]; then
37+
npm run test:all
38+
if [ "${{ github.event.inputs.testGroup }}" == "sanity" ]; then
39+
npm run test:sanity
40+
if [ "${{ github.event.inputs.testGroup }}" == "single_character" ]; then
41+
npm run test:single_character
42+
if [ "${{ github.event.inputs.testGroup }}" == "all_characters" ]; then
43+
npm run test:all_characters
44+
if [ "${{ github.event.inputs.testGroup }}" == "multiple_characters" ]; then
45+
npm run test:multiple_characters
46+
if [ "${{ github.event.inputs.testGroup }}" == "filter_characters" ]; then
47+
npm run test:filter_characters

0 commit comments

Comments
 (0)