Skip to content

Commit 9a62cd7

Browse files
Tests and more (#7)
Added tests (from #1) Fixed langs command (from #6) Code refactoring
1 parent 8e4940a commit 9a62cd7

File tree

22 files changed

+337
-37
lines changed

22 files changed

+337
-37
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Auto detect text files and perform LF normalization
21
* text=auto
2+
src/TestRepository/** linguist-vendored
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Install Tokei'
2+
description: 'Install Tokei on Windows, Linux and Mac using Cargo'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Install Tokei via Cargo
8+
shell: bash
9+
run: |
10+
if ! command -v tokei &> /dev/null; then
11+
echo "Tokei not found, installing..."
12+
cargo install tokei
13+
else
14+
echo "Tokei is already installed."
15+
fi
16+
17+
- name: Verify Installation
18+
shell: bash
19+
run: tokei --version

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ permissions:
1212
attestations: write
1313

1414
jobs:
15+
test:
16+
uses: ./.github/workflows/test.yml
17+
1518
build:
1619
runs-on: ubuntu-latest
1720
env:
@@ -25,7 +28,7 @@ jobs:
2528
- name: Setup .NET
2629
uses: actions/setup-dotnet@v4
2730
with:
28-
dotnet-version: '10.0.102'
31+
dotnet-version: '10.0.x'
2932

3033
- name: Build vv.build and create release artifacts
3134
run: dotnet run --project ${{ env.BUILD_PROJECT }}

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- '**'
10+
workflow_dispatch:
11+
workflow_call:
12+
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Install Tokei
26+
uses: ./.github/actions/install-tokei
27+
28+
- name: Setup .NET
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: '10.0.x'
32+
33+
- name: Restore dependencies
34+
run: dotnet restore src/vv.sln
35+
36+
- name: Test
37+
run: dotnet test src/vv.sln --no-restore
File renamed without changes.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![Test](https://github.com/HardCodeDev777/vv/actions/workflows/test.yml/badge.svg)](https://github.com/HardCodeDev777/vv/actions/workflows/test.yml)
12
[![Release](https://github.com/HardCodeDev777/vv/actions/workflows/release.yml/badge.svg)](https://github.com/HardCodeDev777/vv/actions/workflows/release.yml)
23

34
# vv

src/TestRepository/Program.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace HelloWorld
4+
{
5+
class Program
6+
{
7+
static void Main(string[] args)
8+
{
9+
Console.WriteLine("Hello, World!");
10+
}
11+
}
12+
}

src/TestRepository/gitignore.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test.sh
2+
test.bat

src/TestRepository/test.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
echo HelloWorld

src/TestRepository/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
echo "HelloWorld"

0 commit comments

Comments
 (0)