-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP do not merge - various things for debugging CI
* minimise test * use ubuntu 20 * use oracle jdk17 * run in a loop, don't stop on error * log exit code * upload artifacts if smoketest failed
- Loading branch information
1 parent
e12978b
commit 062b66a
Showing
3 changed files
with
32 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,19 @@ | ||
name: pr | ||
on: pull_request | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, windows-2022, macos-12] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- uses: coursier/cache-action@v6 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
- name: Install Bundler | ||
run: gem install bundler | ||
- name: Delete `.rustup` directory | ||
run: rm -rf /home/runner/.rustup # to save disk space | ||
if: runner.os == 'Linux' | ||
- name: Delete `.cargo` directory # to save disk space | ||
run: rm -rf /home/runner/.cargo | ||
if: runner.os == 'Linux' | ||
- name: Compile and run tests | ||
run: sbt clean +test | ||
formatting: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
- name: Check formatting | ||
run: sbt scalafmtCheck Test/scalafmtCheck | ||
- run: echo "Previous step failed because code is not formatted. Run 'sbt scalafmt Test/scalafmt'" | ||
if: ${{ failure() }} | ||
test-scripts: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
distribution: 'oracle' | ||
java-version: '17' | ||
- run: ./testDistro.sh | ||
- run: | | ||
mkdir /tmp/foo | ||
echo "int foo(int a, int b, int c, int d, int e, int f) {}" > /tmp/foo/foo.c | ||
./joern --src /tmp/foo --run scan | ||
./joern-scan /tmp/foo | ||
./joern-scan --dump | ||
- run: | | ||
cd joern-cli/target/universal/stage | ||
./schema-extender/test.sh | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: debug-artifacts | ||
path: target/debug-artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
#!/bin/bash | ||
set -e #stop on error | ||
# set -e #stop on error | ||
# set -x #verbose on | ||
|
||
readonly SCRIPT_ABS_PATH=$(readlink -f "$0") | ||
readonly SCRIPT_ABS_DIR=$(dirname "$SCRIPT_ABS_PATH") | ||
readonly REPO_ROOT=$SCRIPT_ABS_DIR | ||
|
||
echo "staging joern" | ||
|
||
pushd $REPO_ROOT | ||
sbt -Dsbt.log.noformat=true clean joerncli/stage querydb/createDistribution | ||
tests/frontends-tests.sh | ||
tests/scripts-test.sh | ||
tests/querydb-test.sh | ||
sbt -Dsbt.log.noformat=true clean joerncli/stage | ||
|
||
# when only running frontends-test 10 times the result is either consistently green or consistently red... | ||
# for i in {0..9}; do | ||
# echo "XX0 run $i start" | ||
# tests/frontends-tests.sh | ||
# exit_code=$? | ||
# echo "XX0 run $i end; exit_code=$exit_code" | ||
# done | ||
|
||
tests/frontends-tests.sh | ||
exit_code=$? | ||
mkdir target/debug-artifacts | ||
|
||
if [ $exit_code -ne 0 ] | ||
then | ||
echo "XX1 error" | ||
cp -rp joern-cli/target/universal/stage/lib/* target/debug-artifacts | ||
else | ||
echo "XX1 success" | ||
echo success > target/debug-artifacts/success.txt | ||
fi | ||
popd | ||
|
||
echo "success. go analyse some code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters