Skip to content

Commit 30be7e1

Browse files
authored
Merge pull request #377 from Green-Software-Foundation/dev
1.1.0 Release 🔥
2 parents 3310d86 + ad44005 commit 30be7e1

File tree

501 files changed

+40787
-5774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

501 files changed

+40787
-5774
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: agenda-template
3+
about: Agenda issue template for weekly Carbon Aware SDK community calls
4+
title: "\U0001F3AF"
5+
labels: Agenda
6+
assignees: ''
7+
8+
---
9+
10+
## Date
11+
YYYY-MM-DD - 8am UTC
12+
13+
## Meeting notices
14+
15+
### Antitrust Policy
16+
Linux Foundation meetings involve participation by industry competitors, and it is the intention of the Linux Foundation to conduct all of its activities in accordance with applicable antitrust and competition laws. It is therefore extremely important that attendees adhere to meeting agendas, and be aware of, and not participate in, any activities that are prohibited under applicable US state, federal or foreign antitrust and competition laws.
17+
18+
Examples of types of actions that are prohibited at Linux Foundation meetings and in connection with Linux Foundation activities are described in the Linux Foundation Antitrust Policy available at http://www.linuxfoundation.org/antitrust-policy. If you have questions about these matters, please contact your company counsel, or if you are a member of the Linux Foundation, feel free to contact Andrew Updegrove of the firm of Gesmer Updegrove LLP, which provides legal counsel to the Linux Foundation.
19+
20+
### Recordings
21+
GSF project meetings may be recorded for use solely by the GSF team for administration purposes. In very limited instances, and with explicit approval, recordings may be made more widely available.
22+
23+
### Roll Call
24+
Please *add a comment* to this issue during the meeting to denote attendance.
25+
26+
| Full Name | Affiliation | GitHub username (optional) |
27+
|---|---|---|
28+
|Vaughan Knight | Microsoft | [vaughanknight](https://github.com/vaughanknight) |
29+
30+
Any untracked attendees will be added by the GSF team below
31+
32+
## Agenda
33+
- [ ] Convene & Roll Call (5mins)
34+
- [ ] Review Meeting Notices (see above)
35+
- [ ] Review the agenda and suggest new agenda points
36+
- [ ] Approve Past Meeting Minutes
37+
- [ ] Review Pull Requests
38+
- [ ] Discuss Issues
39+
40+
# PRs
41+
42+
# Issues
43+
44+
## Discussion
45+
- [ ]
46+
47+
## Action Items
48+
- [ ]
49+
50+
**Meeting attended by**

.github/pull_request_template.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
# Pull Request
2+
13
Issue Number: (Link to Github Issue or Azure Dev Ops Task/Story)
24

35
## Summary
6+
47
One sentence summary of PR
58

69
## Changes
@@ -17,11 +20,20 @@ One sentence summary of PR
1720
- [ ] This is not a breaking change. If it is, please describe it below.
1821

1922
## Are there API Changes?
20-
If yes, what are the expected API Changes? Please link to an API-Comparison workflow with the API Diff.
23+
24+
If yes, what are the expected API Changes? Please link to an API-Comparison
25+
workflow with the API Diff.
2126

2227
## Is this a breaking change?
23-
If yes, what workflow does this break?
28+
29+
If yes, what workflow does this break?
2430

2531
## Anything else?
32+
2633
Other comments, collaborators, etc.
27-
This PR Closes Issue #
34+
35+
> Please follow
36+
> [GitHub's suggested syntax](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)
37+
> to link Pull Requests to Issues via keywords
38+
39+
This PR Closes #<issue_number>

.github/workflows/0-stale.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: 0-Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '25 6 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v5
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
stale-issue-message: 'This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.'
25+
close-issue-message: 'This issue has not had any activity for too long. If you believe this issue has been closed in error, please contact an administrator to re-open, or if absolutly relevant and necessary, create a new issue referencing this one. '
26+
stale-pr-message: 'This a stale pull request. Please review, update or/and close as necessary.'
27+
stale-issue-label: 'stale'
28+
stale-pr-label: 'stale'
29+
days-before-issue-stale: 120 #4 months old - initial value aimed to be reduced in the short terms
30+
days-before-issue-close: 20
31+
days-before-pr-stale: 120
32+
operations-per-run: 55 #was not processing all the issues and some issues that should have been stale were missed. This value based on current number of issues (43) and PRs (10)

.github/workflows/1-pr.yaml

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
name: 1-PR checks
2+
on:
3+
pull_request:
4+
branches: [ dev, main ]
5+
workflow_dispatch:
6+
7+
env:
8+
# web app
9+
DOCKERFILE_PATH: "CarbonAware.WebApi/src/Dockerfile"
10+
HEALTH_ENDPOINT: "0.0.0.0:8080/health"
11+
DLL_FILE_PATH: "./bin/Release/net6.0/CarbonAware.WebApi.dll"
12+
DOTNET_SRC_DIR: "./src"
13+
# console app packages
14+
DOTNET_SOLUTION: "src/GSF.CarbonAware/src/GSF.CarbonAware.csproj"
15+
OUTPUT_DIR: "packages"
16+
CONSOLE_APP: "samples/lib-integration/ConsoleApp/ConsoleApp.csproj"
17+
CREATE_PKGS: "scripts/package/create_packages.ps1"
18+
ADD_PKGS: "scripts/package/add_packages.ps1"
19+
20+
21+
jobs:
22+
sln-build-and-test:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
actions: read
26+
contents: read
27+
security-events: write
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
language: [ 'csharp' ]
33+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
34+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
35+
36+
defaults:
37+
run:
38+
working-directory: ./src
39+
steps:
40+
41+
- uses: actions/checkout@v2
42+
- name: Setup .NET
43+
uses: actions/setup-dotnet@v1
44+
with:
45+
dotnet-version: 6.0.x
46+
47+
# Initializes the CodeQL tools for scanning.
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v2
50+
with:
51+
languages: ${{ matrix.language }}
52+
# If you wish to specify custom queries, you can do so here or in a config file.
53+
# By default, queries listed here will override any specified in a config file.
54+
# Prefix the list here with "+" to use these queries and those in the config file.
55+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
56+
57+
- name: Restore dependencies
58+
run: dotnet restore
59+
60+
- name: Build
61+
run: dotnet build --no-restore
62+
63+
- name: Unit Tests
64+
run: dotnet test --no-build --verbosity normal
65+
66+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
67+
# If this step fails, then you should remove it and run the build manually (see below)
68+
#- name: Autobuild
69+
# uses: github/codeql-action/autobuild@v2
70+
71+
# ℹ️ Command-line programs to run using the OS shell.
72+
# 📚 https://git.io/JvXDl
73+
74+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
75+
# and modify them (or add more) to build your code if your project
76+
# uses a compiled language
77+
78+
#- run: |
79+
# make bootstrap
80+
# make release
81+
82+
- name: Perform CodeQL Analysis
83+
uses: github/codeql-action/analyze@v2
84+
85+
webapp-container-dotnet-build:
86+
needs: sln-build-and-test
87+
runs-on: ubuntu-latest
88+
container:
89+
image: mcr.microsoft.com/dotnet/sdk:6.0
90+
steps:
91+
- uses: actions/checkout@v3
92+
93+
- name: Setup .NET Core SDK 6
94+
uses: actions/setup-dotnet@v2
95+
with:
96+
dotnet-version: '6.0.x'
97+
include-prerelease: false
98+
99+
- name: Install dependencies
100+
run: dotnet restore
101+
working-directory: ${{ env.DOTNET_SRC_DIR }}
102+
103+
- name: Install tools
104+
run: dotnet tool restore
105+
working-directory: ${{ env.DOTNET_SRC_DIR }}/CarbonAware.WebApi/src
106+
107+
- name: Build
108+
run: dotnet build --configuration Release --no-restore
109+
working-directory: ${{ env.DOTNET_SRC_DIR }}
110+
111+
- name: Unit Test + Code Coverage
112+
run: dotnet test --filter TestCategory=Unit --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=json
113+
working-directory: ${{ env.DOTNET_SRC_DIR }}
114+
115+
- name: Integration Test + Code Coverage
116+
run: dotnet test --filter TestCategory=Integration --no-restore --verbosity normal /p:CollectCoverage=true /p:MergeWith=\"./coverage.json\" /p:CoverletOutputFormat=\"json,opencover\"
117+
working-directory: ${{ env.DOTNET_SRC_DIR }}
118+
119+
- name: Codecov
120+
uses: codecov/codecov-action@v2
121+
with:
122+
directory: ${{ env.DOTNET_SRC_DIR }}
123+
124+
- name: Generate Open API
125+
run: dotnet tool run swagger tofile --output ./wwwroot/api/v1/swagger.yaml --yaml ${{ env.DLL_FILE_PATH }} v1
126+
working-directory: ./src/CarbonAware.WebApi/src
127+
128+
- name: Upload swagger artifact
129+
uses: actions/upload-artifact@v1
130+
with:
131+
name: pr-swagger.yaml
132+
path: src/CarbonAware.WebApi/src/wwwroot/api/v1/swagger.yaml
133+
134+
webapp-container-validation:
135+
needs: sln-build-and-test
136+
runs-on: ubuntu-latest
137+
steps:
138+
- name: Checkout Repository
139+
uses: actions/checkout@v2
140+
141+
- name: Docker Target Final
142+
run: docker build . -f ${DOCKERFILE_PATH} -t ca-api
143+
working-directory: ./src
144+
145+
- name: Docker Run Container
146+
run: |
147+
docker run -d --name runnable-container -p 8080:80 ca-api
148+
docker container ls
149+
150+
- name: Docker WGET Health Endpoint
151+
run: |
152+
wget -t 5 --waitretry=5 ${HEALTH_ENDPOINT}
153+
154+
api-comparison:
155+
needs: webapp-container-dotnet-build
156+
runs-on: ubuntu-latest
157+
defaults:
158+
run:
159+
working-directory: ./src/CarbonAware.WebApi/src
160+
container:
161+
image: mcr.microsoft.com/dotnet/sdk
162+
steps:
163+
- name: Checkout Dev Branch
164+
uses: actions/checkout@v3
165+
with:
166+
ref: dev
167+
- name: Setup .NET Core SDK 6
168+
uses: actions/setup-dotnet@v2
169+
with:
170+
dotnet-version: '6.0.x'
171+
include-prerelease: false
172+
- name: Install dependencies
173+
run: dotnet restore
174+
working-directory: ${{ env.DOTNET_SRC_DIR }}
175+
- name: Install tools
176+
run: dotnet tool restore
177+
- name: Build
178+
run: dotnet build --configuration Release --no-restore
179+
working-directory: ${{ env.DOTNET_SRC_DIR }}
180+
- name: Generate Open API
181+
run: dotnet tool run swagger tofile --output ./wwwroot/api/v1/swagger.yaml --yaml ${{ env.DLL_FILE_PATH }} v1
182+
- name: Upload dev artifact
183+
uses: actions/upload-artifact@v1
184+
with:
185+
name: dev-swagger.yaml
186+
path: src/CarbonAware.WebApi/src/wwwroot/api/v1/swagger.yaml
187+
- uses: actions/download-artifact@v3
188+
with:
189+
name: pr-swagger.yaml
190+
path: ./src/CarbonAware.WebApi/src/wwwroot/api/v1/pr-swagger.yaml
191+
- name: API Diff Comparison
192+
run: |
193+
diff ./wwwroot/api/v1/pr-swagger.yaml ./wwwroot/api/v1/swagger.yaml && echo "No API Changes detected" || echo "::warning:: API Changed"
194+
195+
dotnet-pack:
196+
needs: sln-build-and-test
197+
runs-on: ubuntu-latest
198+
steps:
199+
- name: Checkout
200+
uses: actions/checkout@v3
201+
202+
- name: Setup .NET Core SDK 6
203+
uses: actions/setup-dotnet@v2
204+
with:
205+
dotnet-version: '6.0.x'
206+
include-prerelease: false
207+
208+
- name: Create packages
209+
shell: pwsh
210+
run: ${{ env.CREATE_PKGS }} ${{ env.DOTNET_SOLUTION }} ${{ env.OUTPUT_DIR }}
211+
212+
- name: Restore current packages for ConsoleApp
213+
run: dotnet restore ${{ env.CONSOLE_APP }}
214+
215+
- name: Add packages to ConsoleApp
216+
shell: pwsh
217+
run: ${{ env.ADD_PKGS }} ${{ env.CONSOLE_APP}} ${{ env.OUTPUT_DIR }}
218+
219+
- name: Cat ConsoleApp project file
220+
run: cat ${{ env.CONSOLE_APP }}
221+
222+
- name: Restore packages for ConsoleApp
223+
run: dotnet restore ${{ env.CONSOLE_APP }}
224+
225+
- name: Build ConsoleApp
226+
run: dotnet build ${{ env.CONSOLE_APP }}
227+
228+
# Non-blocking job that checks .md file locations and also lints them
229+
markdown-linting:
230+
runs-on: ubuntu-latest
231+
steps:
232+
- name: Check out the code
233+
uses: actions/checkout@v2
234+
235+
# See the script for details about exceptions to this check
236+
- name: Markdown files should be located in docs folder
237+
continue-on-error: true
238+
run: "scripts/markdown/check-markdown-files.sh"
239+
240+
- name: markdownlint-cli2-action
241+
uses: DavidAnson/markdownlint-cli2-action@v9
242+
continue-on-error: true
243+
with:
244+
command: config
245+
globs: |
246+
./custom.markdownlint.jsonc
247+
{"*[^.github]/**,*"}.md

0 commit comments

Comments
 (0)