v2.37.0 #925
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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: CI | |
on: | |
push: | |
branches: [ devel ] | |
pull_request: | |
branches: [ devel ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
ports: | |
- 3306 | |
env: | |
MYSQL_ROOT_PASSWORD: rootpw | |
MYSQL_DATABASE: stantest | |
MYSQL_USER: stan | |
MYSQL_PASSWORD: stanpw | |
steps: | |
- name: start mysql | |
run: | | |
sudo /etc/init.d/mysql start || true | |
- name: wait 10s for service | |
uses: jakejarvis/wait-action@v0.1.0 | |
with: | |
time: '10s' | |
- name: verify mysql from container | |
run: | | |
mysql -h 127.0.0.1 -P $MYSQL_PORT -uroot -prootpw -e "SHOW DATABASES" | |
env: | |
MYSQL_PORT: "${{ job.services.mysql.ports['3306'] }}" | |
- uses: actions/checkout@v2 | |
- name: Set up Java 21 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 21 | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
env: | |
MYSQL_PORT: "${{ job.services.mysql.ports['3306'] }}" | |
MYSQL_HOST: localhost | |
MYSQL_RW_USER: stan | |
MYSQL_RW_PASSWORD: stanpw | |
MYSQL_ADMIN_USER: stan | |
MYSQL_ADMIN_PASSWORD: stanpw | |
MYSQL_DATABASE: stantest | |
- name: Run Snyk tests to check for vulnerabilities | |
uses: snyk/actions/node@master #Pre-created container | |
continue-on-error: true # To make sure that CI run is not blocked on Snyk test failure | |
with: | |
command: code test | |
args: --severity-threshold=high | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |