Skip to content
Open

New2 #39

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

env:
DOTNET_VERSION: '8.0' # set this to the .NET Core version to use

on:
push:
branches: [ "main" ]

jobs:
build:
name: CI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build with dotnet
run: dotnet build --configuration Release

- name: dotnet test
run: dotnet test --configuration Release --no-build

- name: dotnet publish
run: dotnet publish src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj --configuration Release -o artifacts

- uses: actions/upload-artifact@v4
with:
name: dometrain-artifact
path: artifacts/
17 changes: 17 additions & 0 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Run every 1 hour

env:
DOTNET_VERSION: '8.0' # set this to the .NET Core version to use

on:
schedule:
- cron: "0 * * * *"

jobs:
cron:
name: Run every 1 hour
runs-on: ubuntu-latest

steps:
- name: Hello world
run: echo "Hello World"
30 changes: 30 additions & 0 deletions .github/workflows/pr-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Verify

env:
DOTNET_VERSION: '8.0' # set this to the .NET Core version to use

on:
pull_request:
branches: [ "main" ]

jobs:
build:
name: PR Verify
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build with dotnet
run: dotnet build --configuration Release

- name: dotnet test
run: dotnet test --configuration Release --no-build

- name: dotnet format
run: dotnet format -v detailed --verify-no-changes
18 changes: 18 additions & 0 deletions .github/workflows/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Secrets workflow

env:
DOTNET_VERSION: '8.0' # set this to the .NET Core version to use
API_CSPROJ_PATH: "./src/GitHubActionsDotNet.Api/GitHubActionsDotNet.Api.csproj"

on:
pull_request:
branches: [ "main" ]

jobs:
secrets:
name: Secrets Demo
runs-on: ubuntu-latest

steps:
- name: echo environment variable
run: echo "The value of SECRET_API_KEY is $${{secrets.SECRET_API_KEY}}"
3 changes: 3 additions & 0 deletions src/GitHubActionsDotNet.Api/Models/WeatherForecast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ public record WeatherForecast
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

public string? Summary { get; init; }

public string? Observatory { get; init; }

}