diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index 71641901af..6883bf197d 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -1,4 +1,6 @@ -me: "CodeQL config" +name: "CodeQL config" queries: - name: Run custom queries uses: ./queries +paths-ignore: + - tests \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 66ca1cd3a0..761d70aa53 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,5 +13,6 @@ jobs: - uses: actions/checkout@v1 - uses: ./init with: - config-file: ./.github/codeql/codeql-config.yml + languages: javascript + config-file: ./.github/codeql/codeql-config.yml - uses: ./analyze diff --git a/.github/workflows/integration-testing.yml b/.github/workflows/integration-testing.yml index 6d6e3660cd..d2079d9bcd 100644 --- a/.github/workflows/integration-testing.yml +++ b/.github/workflows/integration-testing.yml @@ -1,22 +1,117 @@ name: "Integration Testing" -on: [push] +on: [push, pull_request] jobs: - dispatch-events: - if: github.event.repository.full_name == 'github/codeql-action' + multi-language-repo_test-autodetect-languages: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + shopt -s dotglob + mv * ../action/ + mv ../action/tests/multi-language-repo/* . + - uses: ./../action/init + - name: Build code + shell: bash + run: ./build.sh + - uses: ./../action/analyze + env: + TEST_MODE: true + + multi-language-repo_test-custom-queries: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + shopt -s dotglob + mv * ../action/ + mv ../action/tests/multi-language-repo/* . + - uses: ./../action/init + with: + languages: cpp,csharp,java,javascript,python + config-file: ./.github/codeql/custom-queries.yml + - name: Build code + shell: bash + run: ./build.sh + - uses: ./../action/analyze + env: + TEST_MODE: true + + # Currently is not possible to analyze Go in conjunction with other languages in macos + multi-language-repo_test-go-custom-queries: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/setup-go@v2 + if: ${{ matrix.os == 'macos-latest' }} + with: + go-version: '^1.13.1' + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + shopt -s dotglob + mv * ../action/ + mv ../action/tests/multi-language-repo/* . + - uses: ./../action/init + with: + languages: go + config-file: ./.github/codeql/custom-queries.yml + - name: Build code + shell: bash + run: ./build.sh + - uses: ./../action/analyze + env: + TEST_MODE: true + + + multi-language-repo_rubocop: runs-on: ubuntu-latest + steps: - - name: Send repository dispatch events + - uses: actions/checkout@v2 + - name: Move codeql-action + shell: bash + run: | + mkdir ../action + shopt -s dotglob + mv * ../action/ + mv ../action/tests/multi-language-repo/* . + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + - name: Install Code Scanning integration + run: bundle add code-scanning-rubocop --version 0.2.0 --skip-install + - name: Install dependencies + run: bundle install + - name: Rubocop run run: | - curl -X POST \ - -H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \ - -H "Accept: application/vnd.github.everest-preview+json" \ - https://api.github.com/repos/Anthophila/amazon-cognito-js-copy/dispatches \ - -d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}' - - curl -X POST \ - -H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \ - -H "Accept: application/vnd.github.everest-preview+json" \ - https://api.github.com/repos/Anthophila/electron-test-action/dispatches \ - -d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}' + bash -c " + bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif + [[ $? -ne 2 ]] + " + - uses: ./../action/upload-sarif + with: + sarif_file: rubocop.sarif + env: + TEST_MODE: true \ No newline at end of file diff --git a/.github/workflows/js-uptodate-check.yml b/.github/workflows/lint-build-test.yml similarity index 71% rename from .github/workflows/js-uptodate-check.yml rename to .github/workflows/lint-build-test.yml index 6ab118f1ea..ca47f74b4e 100644 --- a/.github/workflows/js-uptodate-check.yml +++ b/.github/workflows/lint-build-test.yml @@ -1,8 +1,16 @@ -name: "Check generated JavaScript" +name: "Lint, Build & Test" -on: [pull_request] +on: [push, pull_request] jobs: + tslint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: tslint + run: npm run-script lint + check-js: runs-on: ubuntu-latest @@ -25,3 +33,11 @@ jobs: exit 1 fi echo "Success: JavaScript files are up to date" + + npm-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: npm run-script test + run: npm run-script test \ No newline at end of file diff --git a/.github/workflows/npm-test.yml b/.github/workflows/npm-test.yml deleted file mode 100644 index 2407d338e5..0000000000 --- a/.github/workflows/npm-test.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: "npm run-script test" - -on: [push] - -jobs: - npm-test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: npm run-script test - run: npm run-script test diff --git a/.github/workflows/ts-lint.yml b/.github/workflows/ts-lint.yml deleted file mode 100644 index eaae925b32..0000000000 --- a/.github/workflows/ts-lint.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: "TSLint" - -on: [push] - -jobs: - tslint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: tslint - run: npm run-script lint diff --git a/lib/upload-lib.js b/lib/upload-lib.js index c371c330d5..b50b2f3415 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -58,6 +58,11 @@ exports.combineSarifFiles = combineSarifFiles; // If the request fails then this will retry a small number of times. async function uploadPayload(payload) { core.info('Uploading results'); + // If in test mode we don't want to upload the results + const testMode = process.env['TEST_MODE'] === 'true' || false; + if (testMode) { + return true; + } const githubToken = core.getInput('token'); const ph = new auth.BearerCredentialHandler(githubToken); const client = new http.HttpClient('Code Scanning : Upload SARIF', [ph]); diff --git a/src/upload-lib.ts b/src/upload-lib.ts index f1d9fba244..f5dcd17663 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -52,6 +52,12 @@ export function combineSarifFiles(sarifFiles: string[]): string { async function uploadPayload(payload): Promise { core.info('Uploading results'); + // If in test mode we don't want to upload the results + const testMode = process.env['TEST_MODE'] === 'true' || false; + if (testMode) { + return true; + } + const githubToken = core.getInput('token'); const ph: auth.BearerCredentialHandler = new auth.BearerCredentialHandler(githubToken); const client = new http.HttpClient('Code Scanning : Upload SARIF', [ph]); diff --git a/tests/multi-language-repo/.github/codeql/custom-queries.yml b/tests/multi-language-repo/.github/codeql/custom-queries.yml new file mode 100644 index 0000000000..c2a211db71 --- /dev/null +++ b/tests/multi-language-repo/.github/codeql/custom-queries.yml @@ -0,0 +1,29 @@ +name: Use custom queries + +disable-default-queries: true + +queries: +# Query suites + - name: Select a query suite + uses: ./codeql-qlpacks/complex-python-qlpack/rootAndBar.qls +# QL pack subset + - name: Select a ql file + uses: ./codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql + - name: Select a subfolder + uses: ./codeql-qlpacks/complex-javascript-qlpack/foo + - name: Select a folder with two subfolders + uses: ./codeql-qlpacks/complex-javascript-qlpack/foo2 +# Inrepo QL pack + - name: Select an inrepo ql pack + uses: ./codeql-qlpacks/csharp-qlpack + - name: Java queries + uses: ./codeql-qlpacks/java-qlpack +# External QL packs + - name: Go queries + uses: Anthophila/go-querypack@master + - name: Cpp queries + uses: Anthophila/cpp-querypack@second-branch + - name: Javascript queries + uses: Anthophila/javascript-querypack/show_ifs2.ql@master + - name: Python queries + uses: Anthophila/python-querypack/show_ifs2.ql@second-branch \ No newline at end of file diff --git a/tests/multi-language-repo/Gemfile b/tests/multi-language-repo/Gemfile new file mode 100644 index 0000000000..e84c2d4f87 --- /dev/null +++ b/tests/multi-language-repo/Gemfile @@ -0,0 +1,2 @@ +source "https://rubygems.org" do +end \ No newline at end of file diff --git a/tests/multi-language-repo/Main.java b/tests/multi-language-repo/Main.java new file mode 100644 index 0000000000..9c8b016543 --- /dev/null +++ b/tests/multi-language-repo/Main.java @@ -0,0 +1,8 @@ +class Main { + public static void main(String args[]) { + if (true) { + System.out.println("Hello, World!"); + } + } +} + diff --git a/tests/multi-language-repo/build.sh b/tests/multi-language-repo/build.sh new file mode 100755 index 0000000000..363499ab7e --- /dev/null +++ b/tests/multi-language-repo/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +gcc -o main main.c + +dotnet build + +javac Main.java + diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo/show_ifs.ql new file mode 100644 index 0000000000..bc58378831 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Foo Show Ifs + * @description Foo Show Ifs + * @kind problem + * @id complex-javascript-querypack/foo-show-ifs + */ + +import javascript + +from IfStmt i +select i, "foo if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/bar/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/bar/show_ifs.ql new file mode 100644 index 0000000000..13fde86ec9 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/bar/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Bar Show Ifs + * @description Bar Show Ifs + * @kind problem + * @id complex-javascript-querypack/bar-ifs + */ + +import javascript + +from IfStmt i +select i, "bar if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/barfoo/barfoobar/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/barfoo/barfoobar/show_ifs.ql new file mode 100644 index 0000000000..b9f79d4c46 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/barfoo/barfoobar/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Barfoobar Show Ifs + * @description Barfoobar Show Ifs + * @kind problem + * @id complex-javascript-querypack/barfoobar-ifs + */ + +import javascript + +from IfStmt i +select i, "barfoobar if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql new file mode 100644 index 0000000000..36bd0262c3 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/foo2/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Foo2 Show Ifs + * @description Foo2 Show Ifs + * @kind problem + * @id complex-javascript-querypack/foo2-ifs + */ + +import javascript + +from IfStmt i +select i, "foo2 if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/qlpack.yml new file mode 100644 index 0000000000..95acb04f05 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: complex-javascript-querypack +version: 0.0.1 +libraryPathDependencies: codeql-javascript \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql new file mode 100644 index 0000000000..7b7d436a94 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-javascript-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Root Show Ifs + * @description Root Show Ifs + * @kind problem + * @id complex-javascript-querypack/root-show-ifs + */ + +import javascript + +from IfStmt i +select i, "root if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/bar/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/bar/show_ifs.ql new file mode 100644 index 0000000000..1e12ee2e0c --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/bar/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Foo/Bar Show Ifs + * @description Foo/Bar Show Ifs + * @kind problem + * @id complex-python-querypack/foo/bar/show-ifs + */ + +import python + +from If i +select i, "foo/bar if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/show_ifs.ql new file mode 100644 index 0000000000..85d6b2ff3f --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/foo/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Foo Show Ifs + * @description Foo Show Ifs + * @kind problem + * @id complex-python-querypack/foo/show-ifs + */ + +import python + +from If i +select i, "foo if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/qlpack.yml new file mode 100644 index 0000000000..349294dcfc --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-python-querypack +version: 0.0.1 +libraryPathDependencies: codeql-python \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/rootAndBar.qls b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/rootAndBar.qls new file mode 100644 index 0000000000..6cac869168 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/rootAndBar.qls @@ -0,0 +1,2 @@ +- query: show_ifs.ql +- query: foo/bar/show_ifs.ql \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/show_ifs.ql new file mode 100644 index 0000000000..719eabf693 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/complex-python-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Ifs + * @description Show Ifs + * @kind problem + * @id complex-python-querypack/show-ifs + */ + +import python + +from If i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/qlpack.yml new file mode 100644 index 0000000000..7c2ea26cde --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-cpp-querypack +version: 0.0.1 +libraryPathDependencies: codeql-cpp \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql new file mode 100644 index 0000000000..745a8bb289 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Cpp Ifs + * @description Show Cpp Ifs + * @kind problem + * @id inrepo-cpp-querypack/show-ifs + */ + +import cpp + +from IfStmt i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/qlpack.yml new file mode 100644 index 0000000000..9a54e7e92f --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-csharp-querypack +version: 0.0.1 +libraryPathDependencies: codeql-csharp \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql new file mode 100644 index 0000000000..d67d01ffcd --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Csharp Ifs + * @description Show Csharp Ifs + * @kind problem + * @id inrepo-csharp-querypack/show-ifs + */ + +import csharp + +from IfStmt i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml new file mode 100644 index 0000000000..59ccb68818 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-go-querypack +version: 0.0.1 +libraryPathDependencies: codeql-go \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql new file mode 100644 index 0000000000..8b0c198fc4 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Go Ifs + * @description Show Go Ifs + * @kind problem + * @id inrepo-go-querypack/show-ifs + */ + +import go + +from IfStmt i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/java-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/java-qlpack/qlpack.yml new file mode 100644 index 0000000000..06e8cae7d3 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/java-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-java-querypack +version: 0.0.1 +libraryPathDependencies: codeql-java \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql new file mode 100644 index 0000000000..eafc48cd11 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Java Ifs + * @description Show Java Ifs + * @kind problem + * @id inrepo-java-querypack/show-ifs + */ + +import java + +from IfStmt i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/qlpack.yml new file mode 100644 index 0000000000..f6d5a7b6db --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-javascript-querypack +version: 0.0.1 +libraryPathDependencies: codeql-javascript \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/show_ifs.ql new file mode 100644 index 0000000000..07564d8f82 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/javascript-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Javascript Ifs + * @description Show Javascript Ifs + * @kind problem + * @id inrepo-javascript-querypack/show-ifs + */ + +import javascript + +from IfStmt i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/python-qlpack/qlpack.yml b/tests/multi-language-repo/codeql-qlpacks/python-qlpack/qlpack.yml new file mode 100644 index 0000000000..349294dcfc --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/python-qlpack/qlpack.yml @@ -0,0 +1,3 @@ +name: inrepo-python-querypack +version: 0.0.1 +libraryPathDependencies: codeql-python \ No newline at end of file diff --git a/tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql b/tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql new file mode 100644 index 0000000000..d0fd384da8 --- /dev/null +++ b/tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql @@ -0,0 +1,11 @@ +/** + * @name Show Python Ifs + * @description Show Python Ifs + * @kind problem + * @id inrepo-python-querypack/show-ifs + */ + +import python + +from If i +select i, "hello if" \ No newline at end of file diff --git a/tests/multi-language-repo/csharp.csproj b/tests/multi-language-repo/csharp.csproj new file mode 100644 index 0000000000..376c93ec8e --- /dev/null +++ b/tests/multi-language-repo/csharp.csproj @@ -0,0 +1,9 @@ + + + + Exe + netcoreapp3.1 + multi_language_test + + + diff --git a/tests/multi-language-repo/main.c b/tests/multi-language-repo/main.c new file mode 100644 index 0000000000..846028e8f2 --- /dev/null +++ b/tests/multi-language-repo/main.c @@ -0,0 +1,8 @@ +#include "stdio.h" + +int main(int argc, char **argv) { + if (1) { + printf("Hello, World!\n"); + } +} + diff --git a/tests/multi-language-repo/main.cs b/tests/multi-language-repo/main.cs new file mode 100644 index 0000000000..6dbbddab41 --- /dev/null +++ b/tests/multi-language-repo/main.cs @@ -0,0 +1,12 @@ +using System; + +namespace HelloWorldApp { + class Geeks { + static void Main(string[] args) { + if (true) { + Console.WriteLine("Hello World!"); + } + } + } +} + diff --git a/tests/multi-language-repo/main.go b/tests/multi-language-repo/main.go new file mode 100644 index 0000000000..2c881f49f7 --- /dev/null +++ b/tests/multi-language-repo/main.go @@ -0,0 +1,9 @@ +package main + +import "fmt" + +func main() { + if true { + fmt.Println("hello world") + } +} diff --git a/tests/multi-language-repo/main.js b/tests/multi-language-repo/main.js new file mode 100644 index 0000000000..a537cdffe1 --- /dev/null +++ b/tests/multi-language-repo/main.js @@ -0,0 +1,3 @@ +if (true) { + console.log("Hello, World!"); +} diff --git a/tests/multi-language-repo/main.py b/tests/multi-language-repo/main.py new file mode 100755 index 0000000000..194ad6a655 --- /dev/null +++ b/tests/multi-language-repo/main.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +def main(): + if True: + print("Hello, World!") + +if __name__ == '__main__': + main() + diff --git a/tests/multi-language-repo/main.rb b/tests/multi-language-repo/main.rb new file mode 100755 index 0000000000..234a56f7d0 --- /dev/null +++ b/tests/multi-language-repo/main.rb @@ -0,0 +1,11 @@ +#!/usr/bin/ruby +# frozen_string_literal: true + +def main + v = ARGV[0] + + puts 'with arg?' unless v.nil? + puts 'hello there' +end + +main