diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 106a0a246..41af27582 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -87,7 +87,7 @@ 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: @@ -95,12 +95,12 @@ jobs: - 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" @@ -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 @@ -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 @@ -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' }} diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index d896cb18d..47905c284 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -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 diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 51394511d..8d8713c0b 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -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 diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index bae1e965b..f1ac4829e 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -32,8 +32,8 @@ 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: @@ -41,9 +41,9 @@ jobs: - 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 @@ -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" @@ -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 diff --git a/.gitignore b/.gitignore index feee527dc..a687a694f 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,6 @@ Program.fs # Rust Cargo.toml Cargo.lock + +# C# +*.csproj diff --git a/scripts/generate_c_sharp_project_file.py b/scripts/generate_c_sharp_project_file.py new file mode 100644 index 000000000..96519d190 --- /dev/null +++ b/scripts/generate_c_sharp_project_file.py @@ -0,0 +1,33 @@ +from pathlib import Path + +import yaml + +C_SHARP_ARCHIVE_DIR = Path("archive/c/c-sharp") +C_SHARP_PROJECT_CONTENTS = """\ + + + Library + net{version} + enable + enable + true + + + + + + + +""" + + + +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() diff --git a/scripts/get_codeql_languages.py b/scripts/get_codeql_languages.py index 038b88bfb..c0e21f286 100644 --- a/scripts/get_codeql_languages.py +++ b/scripts/get_codeql_languages.py @@ -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"),