Skip to content

Commit

Permalink
ci: run macOS, Windows, Java tests on ci:fulltest label (#12086)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylemkimon committed Oct 10, 2021
1 parent 948c015 commit beb6e52
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 116 deletions.
110 changes: 0 additions & 110 deletions .github/workflows/build-pr.yml

This file was deleted.

31 changes: 25 additions & 6 deletions .github/workflows/build.yml
Expand Up @@ -6,13 +6,19 @@ on:
- main
- v25

pull_request:

workflow_dispatch:
inputs:
dryRun:
description: 'Dry-Run'
default: 'true'
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# Currently no way to detect automatically (#8153)
DEFAULT_BRANCH: main
Expand All @@ -21,23 +27,39 @@ env:

jobs:
test:
name: ${{ format('test ({0})', matrix.os) }}
runs-on: ${{ matrix.os }}

# tests shouldn't need more time
timeout-minutes: 30

strategy:
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
os: [ubuntu-latest]
node-version: [14]
python-version: [3.9]
java-version: [11]
# skip macOS and Windows test on pull requests without 'ci:fulltest' label
include: >-
${{ fromJSON((github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:fulltest')) && '[{
"os": "macos-latest",
"node-version": 14,
"python-version": 3.9,
"java-version": 11
}, {
"os": "windows-latest",
"node-version": 14,
"python-version": 3.9,
"java-version": 11
}]' || '[]') }}
env:
coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 14 }}
NODE_VERSION: ${{ matrix.node-version }}
PYTHON_VERSION: ${{ matrix.python-version }}
JAVA_VERSION: ${{ matrix.java-version }}
# skip Java tests on pull requests without 'ci:fulltest' label
SKIP_JAVA_TESTS: ${{ matrix.node-version != 14 || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:fulltest')) }}

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # renovate: tag=v2.3.4
Expand All @@ -56,18 +78,14 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up Java ${{ env.JAVA_VERSION }}
if: env.NODE_VERSION == '14'
if: env.SKIP_JAVA_TESTS == 'false'
uses: actions/setup-java@8db439b6b47e5e12312bf036760bbaa6893481ac # renovate: tag=v2.3.1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
java-package: jre
check-latest: false

- name: Skip Java tests
if: env.NODE_VERSION != '14'
run: echo "SKIP_JAVA_TESTS=true" >> $GITHUB_ENV

- name: Init platform
shell: bash
run: |
Expand Down Expand Up @@ -145,6 +163,7 @@ jobs:

release:
needs: [lint, test]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
# release shouldn't need more than 5 min
timeout-minutes: 15
Expand Down

0 comments on commit beb6e52

Please sign in to comment.