Skip to content
17 changes: 11 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@ jobs:

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
changed-files: ${{ steps.changed-files.outputs.files }}
changed-files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2

- name: Get changed code files
id: changed-files
uses: yumemi-inc/changed-files@v3
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6

- name: List all relevant changed files
if: steps.changed-files.outputs.exists == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
Expand All @@ -110,7 +110,7 @@ jobs:
- name: Get CodeQL Languages
id: set-matrix
run: |
matrix=$(python scripts/get_codeql_languages.py --event ${{ github.event_name}} ${{ steps.changed-files.outputs.files }})
matrix=$(python scripts/get_codeql_languages.py --event ${{ github.event_name}} ${{ steps.changed-files.outputs.all_changed_files }})
echo "${matrix}"
echo "matrix={\"include\": ${matrix}}" >> $GITHUB_OUTPUT

Expand All @@ -136,7 +136,7 @@ jobs:
fetch-depth: 2

- name: Read repo config
uses: pietrobolcato/action-read-yaml@1.1.0
uses: Elisity/action-read-yaml@v0.2
id: repo-config
with:
config: repo-config.yml
Expand All @@ -154,6 +154,11 @@ jobs:
- name: Install Dependencies
run: poetry install

# Set up C# for scanning.
- name: Set up C#
if: ${{ matrix.language == 'c#' }}
run: poetry run python scripts/generate_c_sharp_project_file.py

# Workaround for Kotlin scanning.
- name: Set up Kotlin
if: ${{ matrix.language == 'kotlin' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 2

- name: Read repo config
uses: pietrobolcato/action-read-yaml@1.1.0
uses: Elisity/action-read-yaml@v0.2
id: repo-config
with:
config: repo-config.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v6

- name: Read repo config
uses: pietrobolcato/action-read-yaml@1.1.0
uses: Elisity/action-read-yaml@v0.2
id: repo-config
with:
config: repo-config.yml
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ jobs:
runs-on: ubuntu-latest

outputs:
status: ${{ steps.changed-files.outputs.exists }}
changed_files: ${{ steps.changed-files.outputs.files }}
status: ${{ steps.changed-files.outputs.any_changed }}
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2

- name: Get changed code files
id: changed-files
uses: yumemi-inc/changed-files@v3
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
with:
patterns: |
files: |
archive/**
.glotter.yml
repo-config.yml
Expand All @@ -54,9 +54,9 @@ jobs:
!**/*.md

- name: List all relevant changed files
if: steps.changed-files.outputs.exists == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
fetch-depth: 2

- name: Read repo config
uses: pietrobolcato/action-read-yaml@1.1.0
uses: Elisity/action-read-yaml@v0.2
id: repo-config
with:
config: repo-config.yml
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ Program.fs
# Rust
Cargo.toml
Cargo.lock

# C#
*.csproj
33 changes: 33 additions & 0 deletions scripts/generate_c_sharp_project_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from pathlib import Path

import yaml

C_SHARP_ARCHIVE_DIR = Path("archive/c/c-sharp")
C_SHARP_PROJECT_CONTENTS = """\
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net{version}</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
</PropertyGroup>

<ItemGroup>
<!-- Exclude all .cs files; the build process handles compilation individually -->
<Compile Remove="**/*.cs" />
</ItemGroup>
</Project>
"""



def main():
testinfo = yaml.safe_load((C_SHARP_ARCHIVE_DIR / "testinfo.yml").read_text(encoding="utf-8"))
tag = testinfo["container"]["tag"]
project_contents = C_SHARP_PROJECT_CONTENTS.format(version=tag)
(C_SHARP_ARCHIVE_DIR / "MyProj.csproj").write_text(project_contents, encoding="utf-8")


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion scripts/get_codeql_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LanguageInfo:
"scripts/*.py": LanguageInfo(language="python"),
"archive/c/c/*.c": LanguageInfo(language="c", build_mode="manual"),
"archive/c/c-plus-plus/*.cpp": LanguageInfo(language="cpp", build_mode="manual"),
"archive/c/c-sharp/*.cs": LanguageInfo(language="c#"),
"archive/c/c-sharp/*.cs": LanguageInfo(language="c#", build_mode="autobuild"),
"archive/g/go/*.go": LanguageInfo(language="go", build_mode="autobuild"),
"archive/j/java/*.java": LanguageInfo(language="java", build_mode="manual"),
"archive/j/javascript/*.js": LanguageInfo(language="javascript"),
Expand Down
Loading