Skip to content

Commit

Permalink
Run Sonar scan only to speed up debugging process
Browse files Browse the repository at this point in the history
  • Loading branch information
algomaster99 committed May 20, 2022
1 parent 3d8aa20 commit e08d9ba
Showing 1 changed file with 0 additions and 105 deletions.
105 changes: 0 additions & 105 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,117 +31,12 @@ jobs:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
with:
fetch-depth: 0 # SonarCloud prefers non-shallow clones
- uses: actions/setup-java@860f60056505705214d223b91ed7a30f173f6142 # tag=v3.3.0
with:
java-version: 11
java-package: jdk
architecture: x64
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Get date for cache # see https://github.com/actions/cache README
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: Use Maven dependency cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Use SonarCloud package cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3.0.2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Check formatting with spotless
if: ${{ matrix.os == 'ubuntu-latest' }}
run: mvn spotless:check
- name: Build project
run: |
mvn -B package -DskipTests
mvn -B test-compile
- name: Fetch final dependencies
# this is a hack to fetch some test runtime dependencies
run: timeout 10 mvn -B test || echo "Done fetching dependencies"
shell: bash
- name: Run tests
run: mvn test
- name: Test memory-constrained execution with segment repair
shell: bash
run: .github/mem-constrained-exec.sh
- name: Run Sonar
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # tag=v3.1.0

test-support-scripts:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
- uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3.0.0
with:
python-version: 3.8
- uses: actions/setup-java@860f60056505705214d223b91ed7a30f173f6142 # tag=v3.3.0
with:
java-version: 11
java-package: jdk
architecture: x64
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Get date for cache # see https://github.com/actions/cache README
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: Use Maven dependency cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: Package Sorald
run: mvn package -DskipTests
- name: Test support scripts
run: |
cd experimentation/tools
pip install --upgrade pip
pip install -e .[TEST]
pytest tests/
test-code-generation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
- uses: actions/setup-java@860f60056505705214d223b91ed7a30f173f6142 # tag=v3.3.0
with:
java-version: 11
java-package: jdk
architecture: x64
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Get date for cache # see https://github.com/actions/cache README
id: get-date
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: Use Maven dependency cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3.0.2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: Test that generated code is up-to-date
run: |
mvn install -DskipTests
cd sorald && mvn clean compile dependency:build-classpath -Dmdep.outputFile=cp.txt
cd sorald && java -cp "$(cat cp.txt):.target/classes" sorald.CodeGenerator
cd sorald && mvn spotless:apply
git diff --exit-code

0 comments on commit e08d9ba

Please sign in to comment.