11name : " Integration Testing"
22
3- on : [push]
3+ on : [push, pull_request ]
44
55jobs :
6- dispatch-events :
7- if : github.event.repository.full_name == 'github/codeql-action'
6+ multi-language-repo_test-autodetect-languages :
7+ strategy :
8+ matrix :
9+ os : [ubuntu-latest, windows-latest, macos-latest]
10+ runs-on : ${{ matrix.os }}
11+
12+ steps :
13+ - uses : actions/checkout@v2
14+ - name : Move codeql-action
15+ shell : bash
16+ run : |
17+ mkdir ../action
18+ shopt -s dotglob
19+ mv * ../action/
20+ mv ../action/tests/multi-language-repo/* .
21+ - uses : ./../action/init
22+ - name : Build code
23+ shell : bash
24+ run : ./build.sh
25+ - uses : ./../action/analyze
26+ env :
27+ TEST_MODE : true
28+
29+ multi-language-repo_test-custom-queries :
30+ strategy :
31+ matrix :
32+ os : [ubuntu-latest, windows-latest, macos-latest]
33+ runs-on : ${{ matrix.os }}
34+
35+ steps :
36+ - uses : actions/checkout@v2
37+ - name : Move codeql-action
38+ shell : bash
39+ run : |
40+ mkdir ../action
41+ shopt -s dotglob
42+ mv * ../action/
43+ mv ../action/tests/multi-language-repo/* .
44+ - uses : ./../action/init
45+ with :
46+ languages : cpp,csharp,java,javascript,python
47+ config-file : ./.github/codeql/custom-queries.yml
48+ - name : Build code
49+ shell : bash
50+ run : ./build.sh
51+ - uses : ./../action/analyze
52+ env :
53+ TEST_MODE : true
54+
55+ # Currently is not possible to analyze Go in conjunction with other languages in macos
56+ multi-language-repo_test-go-custom-queries :
57+ strategy :
58+ matrix :
59+ os : [ubuntu-latest, windows-latest, macos-latest]
60+ runs-on : ${{ matrix.os }}
61+
62+ steps :
63+ - uses : actions/setup-go@v2
64+ if : ${{ matrix.os == 'macos-latest' }}
65+ with :
66+ go-version : ' ^1.13.1'
67+ - uses : actions/checkout@v2
68+ - name : Move codeql-action
69+ shell : bash
70+ run : |
71+ mkdir ../action
72+ shopt -s dotglob
73+ mv * ../action/
74+ mv ../action/tests/multi-language-repo/* .
75+ - uses : ./../action/init
76+ with :
77+ languages : go
78+ config-file : ./.github/codeql/custom-queries.yml
79+ - name : Build code
80+ shell : bash
81+ run : ./build.sh
82+ - uses : ./../action/analyze
83+ env :
84+ TEST_MODE : true
85+
86+
87+ multi-language-repo_rubocop :
888 runs-on : ubuntu-latest
89+
990 steps :
10- - name : Send repository dispatch events
91+ - uses : actions/checkout@v2
92+ - name : Move codeql-action
93+ shell : bash
94+ run : |
95+ mkdir ../action
96+ shopt -s dotglob
97+ mv * ../action/
98+ mv ../action/tests/multi-language-repo/* .
99+ - name : Set up Ruby
100+ uses : ruby/setup-ruby@v1
101+ with :
102+ ruby-version : 2.6
103+ - name : Install Code Scanning integration
104+ run : bundle add code-scanning-rubocop --version 0.2.0 --skip-install
105+ - name : Install dependencies
106+ run : bundle install
107+ - name : Rubocop run
11108 run : |
12- curl -X POST \
13- -H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \
14- -H "Accept: application/vnd.github.everest-preview+json" \
15- https://api.github.com/repos/Anthophila/amazon-cognito-js-copy/dispatches \
16- -d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}'
17-
18- curl -X POST \
19- -H "Authorization: Bearer ${{ secrets.CODEQL_TESTING_TOKEN }}" \
20- -H "Accept: application/vnd.github.everest-preview+json" \
21- https://api.github.com/repos/Anthophila/electron-test-action/dispatches \
22- -d '{"event_type":"codeql-integration","client_payload": {"sha": "${{ github.sha }}"}}'
109+ bash -c "
110+ bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
111+ [[ $? -ne 2 ]]
112+ "
113+ - uses : ./../action/upload-sarif
114+ with :
115+ sarif_file : rubocop.sarif
116+ env :
117+ TEST_MODE : true
0 commit comments