Skip to content

chore: update download CLI URL (#192) #297

chore: update download CLI URL (#192)

chore: update download CLI URL (#192) #297

Workflow file for this run

name: Build and Test
on: push
jobs:
test:
strategy:
fail-fast: false # we care about other platforms and channels building
matrix:
os: [ ubuntu, macos, windows ]
maven_version: [ 3.2.5, 3.6.3 ]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Cache Local Maven Repository
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Install Maven for Acceptance Tests
run: |
mvn -N "io.takari:maven:0.7.7:wrapper" "-Dmaven=${{matrix.maven_version}}"
./mvnw --version
- name: Install Plugin to .m2
run: mvn -B install "-DskipTests" "-Dinvoker.skip=true"
- name: Run Unit Tests
run: mvn -B surefire:test
- name: Install Snyk CLI (Ubuntu/macOS)
if: ${{ matrix.os != 'windows' }}
run: |
sudo npm install -g snyk
snyk -v
which snyk
- name: Install Snyk CLI (Windows)
if: ${{ matrix.os == 'windows' }}
run: |
npm install -g snyk
snyk -v
where snyk
- name: Run Acceptance Tests (Ubuntu)
if: ${{ matrix.os == 'ubuntu' }}
run: mvn -B invoker:install invoker:run
env:
POM_EXCLUDE_CODE_TEST: "test-code-test/pom.xml"
SNYK_TEST_TOKEN: ${{secrets.SNYK_TEST_TOKEN}}
SNYK_CLI_EXECUTABLE: /usr/local/bin/snyk
SNYK_DOWNLOAD_DESTINATION: "downloads/snyk"
- name: Run Acceptance Tests (macOS)
if: ${{ matrix.os == 'macos' }}
run: mvn -B invoker:install invoker:run
env:
POM_EXCLUDE_CODE_TEST: "test-code-test/pom.xml"
SNYK_TEST_TOKEN: ${{secrets.SNYK_TEST_TOKEN}}
SNYK_CLI_EXECUTABLE: /opt/homebrew/bin/snyk
SNYK_DOWNLOAD_DESTINATION: "downloads/snyk"
- name: Run Acceptance Tests (Windows)
if: ${{ matrix.os == 'windows' }}
run: mvn -B invoker:install invoker:run
env:
POM_EXCLUDE_CODE_TEST: "test-code-test/pom.xml"
POM_EXCLUDE_PATTERN: "test-container-test/pom.xml"
SNYK_TEST_TOKEN: ${{secrets.SNYK_TEST_TOKEN}}
SNYK_CLI_EXECUTABLE: "C:\\npm\\prefix\\snyk.cmd"
SNYK_DOWNLOAD_DESTINATION: "downloads\\snyk.exe"
- name: Show Integration Test build.log files
if: ${{ failure() }}
run: cat target/it/**/build.log