mirror of
https://github.com/actions/setup-java
synced 2024-11-09 23:22:40 +00:00
457d7a4579
This allows calling the action multiple times in the same job and retrieving the path and/or version in other steps. Fixes #65
88 lines
2.5 KiB
YAML
88 lines
2.5 KiB
YAML
name: Main workflow
|
|
on: [push, pull_request]
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.operating-system }}
|
|
strategy:
|
|
matrix:
|
|
operating-system: [ubuntu-latest, windows-latest]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup Node.js 12
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 12.x
|
|
- name: npm install
|
|
run: npm install
|
|
- name: Lint
|
|
run: npm run format-check
|
|
- name: npm test
|
|
run: npm test
|
|
|
|
test:
|
|
runs-on: ${{ matrix.operating-system }}
|
|
strategy:
|
|
matrix:
|
|
operating-system: [ubuntu-latest, windows-latest]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Clear tool cache
|
|
if: runner.os != 'windows'
|
|
run: mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
|
|
- name: Clear tool cache (Windows)
|
|
if: runner.os == 'windows'
|
|
run: move "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
|
|
- name: Setup Java 13
|
|
id: setup-java
|
|
uses: ./
|
|
with:
|
|
java-version: 13.0.2
|
|
- name: Verify Java 13
|
|
if: runner.os != 'windows'
|
|
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"
|
|
- name: Verify Java 13 (Windows)
|
|
if: runner.os == 'windows'
|
|
run: __tests__/verify-java.ps1 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"
|
|
|
|
test-proxy:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ubuntu:latest
|
|
options: --dns 127.0.0.1
|
|
services:
|
|
squid-proxy:
|
|
image: datadog/squid:latest
|
|
ports:
|
|
- 3128:3128
|
|
env:
|
|
https_proxy: http://squid-proxy:3128
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Clear tool cache
|
|
run: rm -rf $RUNNER_TOOL_CACHE/*
|
|
- name: Setup Java 13
|
|
id: setup-java
|
|
uses: ./
|
|
with:
|
|
java-version: 13.0.2
|
|
- name: Verify Java 13
|
|
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"
|
|
|
|
test-bypass-proxy:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
https_proxy: http://no-such-proxy:3128
|
|
no_proxy: github.com,static.azul.com
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Clear tool cache
|
|
run: rm -rf $RUNNER_TOOL_CACHE/*
|
|
- name: Setup Java 13
|
|
id: setup-java
|
|
uses: ./
|
|
with:
|
|
java-version: 13.0.2
|
|
- name: Verify Java 13
|
|
run: __tests__/verify-java.sh 13.0.2 "${{ steps.setup-java.outputs.path }}" "${{ steps.setup-java.outputs.version }}"
|