setup-java/.github/workflows/workflow.yml

89 lines
2.5 KiB
YAML
Raw Permalink Normal View History

name: Main workflow
2019-12-31 06:04:50 +00:00
on: [push, pull_request]
jobs:
2020-02-11 23:17:37 +00:00
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest]
2019-07-26 02:59:48 +00:00
steps:
2019-07-23 17:22:25 +00:00
- name: Checkout
2020-02-11 21:21:01 +00:00
uses: actions/checkout@v2
2020-02-11 23:17:37 +00:00
- name: Setup Node.js 12
2020-02-11 21:21:01 +00:00
uses: actions/setup-node@v1
with:
2020-02-11 21:21:01 +00:00
node-version: 12.x
- name: npm install
run: npm install
- name: Lint
run: npm run format-check
- name: npm test
run: npm test
2020-02-11 23:17:37 +00:00
test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest]
2020-02-06 20:16:41 +00:00
steps:
- name: Checkout
2020-02-11 21:21:01 +00:00
uses: actions/checkout@v2
2020-02-11 23:17:37 +00:00
- 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
2020-02-11 23:17:37 +00:00
uses: ./
2020-02-06 20:16:41 +00:00
with:
2020-02-11 23:17:37 +00:00
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 }}"
2020-02-11 23:17:37 +00:00
- 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 }}"
2020-02-06 20:16:41 +00:00
2020-02-11 23:17:37 +00:00
test-proxy:
runs-on: ubuntu-latest
container:
image: ubuntu:latest
options: --dns 127.0.0.1
services:
squid-proxy:
image: ubuntu/squid:latest
2020-02-11 23:17:37 +00:00
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
2020-02-11 23:17:37 +00:00
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 }}"
2020-02-06 20:16:41 +00:00
2020-02-11 23:17:37 +00:00
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
2020-02-11 23:17:37 +00:00
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 }}"