forked from joernio/joern
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (109 loc) · 3.29 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: pr
on: pull_request
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install sbt
if: matrix.os == 'macos-latest'
run: brew install sbt
- name: Install php
if: matrix.os == 'macos-latest'
run: brew install php
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Set up Go
uses: actions/setup-go@v5
with:
cache: false
go-version: 1.18
- name: Set up Swift
if: matrix.os == 'windows-latest'
uses: SwiftyLab/setup-swift@latest
with:
development: true
swift-version: "5.10"
- name: Install Bundler
run: gem install bundler -v 2.4.22
- 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'
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- name: Compile and run tests
run: sbt clean test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- name: Check formatting
run: sbt scalafmtCheck Test/scalafmtCheck
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "Previous step failed because code is not formatted. Run 'sbt scalafmt Test/scalafmt'"
if: ${{ failure() }}
- name: Validate CITATION.cff
uses: dieghernan/cff-validator@v3
test-scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- run: export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} && ./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
./joern-slice data-flow -o target/slice
- run: |
cd joern-cli/target/universal/stage
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} && ./schema-extender/test.sh