fix(analyzer): Add a test for dangling embed directives / GoMod #9173
Workflow file for this run
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
name: Build and Test | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false | |
ASKALONO_VERSION: 0.4.6 | |
BOYTERLC_VERSION: 1.3.1 | |
LICENSEE_VERSION: 9.15.3 | |
SCANCODE_VERSION: 31.2.4 | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Build all classes | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
arguments: --scan classes -x :plugins:reporters:web-app-template:yarnBuild | |
build-web-app-reporter: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Build the web-app-reporter | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
arguments: --scan :plugins:reporters:web-app-template:yarnBuild | |
codeql-analysis: | |
needs: build | |
runs-on: ubuntu-22.04 | |
permissions: | |
security-events: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: java | |
tools: latest | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Build all classes | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
arguments: -Dorg.gradle.jvmargs=-Xmx1g classes -x :plugins:reporters:web-app-template:yarnBuild | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
test: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Run unit tests | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
arguments: --scan test jacocoTestReport -x :plugins:reporters:web-app-template:yarnBuild | |
- name: Upload code coverage data | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: test | |
funTest-non-docker: | |
needs: build-web-app-reporter | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install required tools | |
run: | | |
# Uninstall mono-devel because it contains the "lc" command which conflicts with BoyterLc. | |
sudo apt-get -qq remove mono-devel | |
# Install git-repo. | |
mkdir -p $HOME/.local/bin | |
curl https://storage.googleapis.com/git-repo-downloads/repo -o $HOME/.local/bin/repo | |
chmod a+x $HOME/.local/bin/repo | |
# Install Askalono for functional tests. | |
curl -LOs https://github.com/amzn/askalono/releases/download/$ASKALONO_VERSION/askalono-Linux.zip | |
unzip askalono-Linux.zip -d $HOME/.local/bin | |
# Install Boyter Lc for functional tests. | |
curl -LOs https://github.com/boyter/lc/releases/download/v$BOYTERLC_VERSION/lc-$BOYTERLC_VERSION-x86_64-unknown-linux.zip | |
unzip lc-$BOYTERLC_VERSION-x86_64-unknown-linux.zip -d $HOME/.local/bin | |
# Install Licensee for functional tests. | |
echo "gem: --bindir $HOME/.local/bin" > $HOME/.gemrc | |
gem install --user-install licensee -v $LICENSEE_VERSION | |
# Install ScanCode for license texts. | |
curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt | |
pip install --no-cache-dir --constraint requirements.txt scancode-toolkit==$SCANCODE_VERSION | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Run functional tests that do not require external tools | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
arguments: --scan -Ptests.exclude=org.ossreviewtoolkit.cli.*,org.ossreviewtoolkit.analyzer.*,org.ossreviewtoolkit.plugins.packagemanagers.* funTest jacocoFunTestReport | |
- name: Upload code coverage data | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: funTest-non-docker | |
funTest-docker: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Validate Batect wrapper scripts | |
uses: batect/batect-wrapper-validation-action@v0 | |
- name: Run functional tests that do require external tools | |
run: | | |
echo "Running as $(id)." | |
BATECT_QUIET_DOWNLOAD=true ./batect --enable-buildkit \ | |
--config-var docker_build_user_id=1001 \ | |
--config-var gradle_build_scan=true \ | |
--config-var gradle_console=plain \ | |
runFunTest | |
- name: Upload code coverage data | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: funTest-docker |