Merge pull request #351 from vincent4vx/feature-349-db-no-pool #336
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: Java CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: szenius/set-timezone@v1.0 | |
with: | |
timezoneLinux: "Europe/Paris" | |
- uses: mirromutth/mysql-action@v1.1 | |
with: | |
mysql version: '5.7' | |
mysql database: 'araknemu' | |
mysql user: 'araknemu' | |
mysql password: 'araknemu' | |
mysql root password: 'root' | |
- name: Create MySQL user | |
run: | | |
while : | |
do | |
sleep 1 | |
mysql -h 127.0.0.1 -u root --password=root -e 'select version()' && break | |
done | |
cat <<EOF | mysql -h 127.0.0.1 -u root --password=root | |
CREATE USER 'araknemu'@'%' IDENTIFIED BY 'araknemu'; | |
GRANT ALL PRIVILEGES ON *.* TO 'araknemu'@'%'; | |
FLUSH PRIVILEGES; | |
EOF | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots -P '!checkerframework,!checkerframework-jdk8,!checkerframework-jdk9orlater' verify | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: target/site/jacoco/jacoco.xml | |
verbose: true | |
java_compatibility: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java_version: [8, 11, 14, 17] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: szenius/set-timezone@v1.0 | |
with: | |
timezoneLinux: "Europe/Paris" | |
- uses: mirromutth/mysql-action@v1.1 | |
with: | |
mysql version: '5.7' | |
mysql database: 'araknemu' | |
mysql user: 'araknemu' | |
mysql password: 'araknemu' | |
mysql root password: 'root' | |
- name: Create MySQL user | |
run: | | |
while : | |
do | |
sleep 1 | |
mysql -h 127.0.0.1 -u root --password=root -e 'select version()' && break | |
done | |
cat <<EOF | mysql -h 127.0.0.1 -u root --password=root | |
CREATE USER 'araknemu'@'%' IDENTIFIED BY 'araknemu'; | |
GRANT ALL PRIVILEGES ON *.* TO 'araknemu'@'%'; | |
FLUSH PRIVILEGES; | |
EOF | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v2 | |
with: | |
java-version: ${{ matrix.java_version }} | |
distribution: 'adopt' | |
- name: Run tests | |
run: mvn --batch-mode -Djacoco.skip=true -P '!checkerframework,!checkerframework-jdk8,!checkerframework-jdk9orlater' test | |
static_analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: szenius/set-timezone@v1.0 | |
with: | |
timezoneLinux: "Europe/Paris" | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 11 | |
distribution: 'adopt' | |
- name: Run tests | |
run: mvn clean compile |