diff --git a/.github/workflows/cli_script_check.yml b/.github/workflows/cli_script_check.yml new file mode 100644 index 0000000..fea75d4 --- /dev/null +++ b/.github/workflows/cli_script_check.yml @@ -0,0 +1,130 @@ +# Workflow to build and check cli_scripts in Linux and Windows + +name: Check mta-cli scripts + + +on: + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + # build_windup job + build_windup: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.4 + with: + repository: windup/windup + path: windup + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + java-package: jdk + - name: Cache Maven packages + uses: actions/cache@v2.1.6 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build on JDK 8 skipping tests + run: + mvn -B clean install -DskipTests + working-directory: windup + + # build_windup_rulesets job + build_windup_rulesets: + runs-on: ubuntu-latest + needs: build_windup + + steps: + - uses: actions/checkout@v2.3.4 + with: + repository: windup/windup-rulesets + path: windup-rulesets + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + java-package: jdk + - name: Cache Maven packages + uses: actions/cache@v2.1.6 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build on JDK 8 + run: mvn -B clean install -DskipTests + working-directory: windup-rulesets + + # build_cli job + build_cli: + runs-on: ubuntu-latest + needs: [build_windup, build_windup_rulesets] + + steps: + - uses: actions/checkout@v2.3.4 + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + java-package: jdk + - name: Cache Maven packages + uses: actions/cache@v2.1.6 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build on JDK 8 + run: mvn -B clean install + - name: upload mta-cli zip + uses: actions/upload-artifact@v2 + with: + name: mta-cli-zip + path: target/*.zip + retention-days: 5 + + # "linux-script-check" job + linux-script-check: + runs-on: ubuntu-latest + needs: build_cli + + steps: + + - name: Download mta-cli-zip + uses: actions/download-artifact@v2 + with: + name: mta-cli-zip + + - name: unzip and run mta-cli + run: | + unzip mta-cli*offline.zip + cd mta-cli*/bin + ./mta-cli discoverTargets + + # "windows-script-check" job + windows-script-check: + runs-on: windows-latest + needs: [build_cli, linux-script-check] + + steps: + + - name: Download mta-cli-zip + uses: actions/download-artifact@v2 + with: + name: mta-cli-zip + + - name: unzip and run mta-cli + run: | + unzip mta-cli*offline.zip + cd mta-cli* + cd bin + cmd.exe mta-cli.bat discoverTargets