name: "Integration Testing" on: [push, pull_request] jobs: multi-language-repo_test-autodetect-languages: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Move codeql-action shell: bash run: | mkdir ../action mv * .github ../action/ mv ../action/tests/multi-language-repo/{*,.github} . - uses: ./../action/init - name: Build code shell: bash run: ./build.sh - uses: ./../action/analyze env: TEST_MODE: true - run: | cd "$CODEQL_ACTION_DATABASE_DIR" # List all directories as there will be precisely one directory per database # but there may be other files in this directory such as query suites. if [ "$(ls -d */ | wc -l)" != 6 ] || \ [[ ! -d cpp ]] || \ [[ ! -d csharp ]] || \ [[ ! -d go ]] || \ [[ ! -d java ]] || \ [[ ! -d javascript ]] || \ [[ ! -d python ]]; then echo "Did not find expected number of databases. Database dir contains: $(ls)" exit 1 fi multi-language-repo_test-custom-queries: strategy: fail-fast: false 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 mv * .github ../action/ mv ../action/tests/multi-language-repo/{*,.github} . - 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: fail-fast: false 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 mv * .github ../action/ mv ../action/tests/multi-language-repo/{*,.github} . - 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: - uses: actions/checkout@v2 - name: Move codeql-action shell: bash run: | mkdir ../action mv * .github ../action/ mv ../action/tests/multi-language-repo/{*,.github} . - 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.3.0 --skip-install - name: Install dependencies run: bundle install - name: Rubocop run run: | 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 retrieval-of-remote-config: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: # Must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head of the pull request. fetch-depth: 2 # If this run was triggered by a pull request event then checkout # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - uses: ./init with: languages: javascript config-file: github/codeql-action/.github/codeql/codeql-config.yml@main - uses: ./analyze