50 lines
1016 B
YAML
50 lines
1016 B
YAML
name: First CI
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build the project
|
|
run: dotnet build
|
|
|
|
- name: Run tests
|
|
run: dotnet test
|
|
|
|
- name: Publish application
|
|
run: dotnet publish -o app -r linux-x64 --sc /p:PublishSingleFile=true /p:AssemblyName=app
|
|
|
|
- name: Create tarball
|
|
run: tar cf app.tar app/
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: app.tar
|
|
path: app.tar
|
|
|
|
test:
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: app.tar
|
|
|
|
- name: Extract tarball
|
|
run: tar xf app.tar
|
|
|
|
- name: Run the application
|
|
run: ./app/app
|