Skip to content

Update main.yml

Update main.yml #4

Workflow file for this run

name: Java CI
on: [push, pull_request]
jobs:
setup_node:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node modules
id: cache-key
run: echo "::set-output name=key::$(echo \"Node.js\")-$(echo ${{ hashFiles('**/package-lock.json') }})"
build:
needs: setup_node
runs-on: ubuntu-latest
container:
image: openjdk:11
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for run.sh
run: chmod +x run.sh
- name: Print Java version
run: java --version
- name: Compile
run: ./run.sh compile
build_test:
needs: [setup_node, build]
runs-on: ubuntu-latest
container:
image: openjdk:11
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Compile Tests
run: ./run.sh compileTests
test:
needs: [setup_node, build_test]
runs-on: ubuntu-latest
container:
image: openjdk:11
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Test
run: ./run.sh test