Skip to content

Bump actions/setup-java from 4.2.2 to 4.4.0 #3687

Bump actions/setup-java from 4.2.2 to 4.4.0

Bump actions/setup-java from 4.2.2 to 4.4.0 #3687

Workflow file for this run

# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt)
# Licensed under the EUPL-1.2-or-later.
#
# You may obtain a copy of the Licence at:
# https://joinup.ec.europa.eu/software/page/eupl
#
# SPDX-License-Identifier: EUPL-1.2
name: cli-ci
concurrency:
group: cli-ci-${{ github.head_ref }}
# In order to conserve the use of GitHub Actions, we cancel the running action
# of the previous commit. This means that if you first commit "A" and then
# commit "B" to the pull request a few minutes later, the workflow for commit
# "A" will be cancelled.
cancel-in-progress: true
on:
pull_request:
types:
- opened
- synchronize
- reopened
# It's important to trigger this workflow again when the pull is changing
# from a draft pull request to a ready for review pull request.
#
# Some jobs are skipped when the pull request is a draft. Therefore, we
# need to trigger these jobs again when the pull request is changing to
# ready for review.
- ready_for_review
merge_group:
types:
- checks_requested
env:
CI_CD_DART_SCRIPTS_PACKAGE_PATH: "tools/sz_repo_cli/"
jobs:
# We can't use the official "paths" filter because it has no support for merge
# groups and we would need some kind of fallback CI when a check is required
# but ignored because of the path filter.
#
# See:
# * https://github.com/community/community/discussions/45899 (merge groups)
# * https://github.com/github/docs/commit/4364076e0fb56c2579ae90cd048939eaa2c18954
# (workaround for required checks with path filters)
changes:
runs-on: ubuntu-22.04
outputs:
changesFound: ${{ steps.filter.outputs.changesFound }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: AurorNZ/paths-filter@3b1f3abc3371cca888d8eb03dfa70bc8a9867629
id: filter
with:
filters: |
changesFound:
# When we change the Flutter version, we need to trigger this workflow.
- ".fvm/fvm_config.json"
# Changes in the CLI directory should trigger the CI.
- "tools/sz_repo_cli/**"
# We trigger also this workflow, if this workflow is changed, so that new
# changes will be applied.
- ".github/workflows/cli_ci.yml"
# The following paths are excluded from the above paths. It's important to
# list the paths at the end of the file, so that the exclude paths are
# applied.
#
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths.
- "!**/*.md"
- "!**/*.mdx"
- "!**/*.gitignore"
- "!**/firebase.json"
- "!**/.firebaserc"
analyze:
needs: changes
runs-on: ubuntu-22.04
# In draft PRs we might use TODOs temporarily.
# In this case the analyze pipeline would fail, thus we won't run it.
if: ${{ github.event.pull_request.draft == false && needs.changes.outputs.changesFound == 'true' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set Flutter version from FVM config file to environment variables
id: fvm-config-action
uses: kuhnroyal/flutter-fvm-config-action@4155f8ca4c30a4f2f50df69caa0e4259f6cd1142
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- name: Activate sz_repo_cli package
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(realpath ./bin) >> $GITHUB_PATH
- name: Run code analysis via "sz analyze" (formatting, issues, spacing ...)
# We don't run the analysis in parallel to prevent
# https://github.com/SharezoneApp/sharezone-app/issues/1658.
run: |
sz analyze \
--max-concurrent-packages 1 \
--package-timeout-minutes 15 \
--only sz_repo_cli
test:
needs: changes
# Because we run our the tests for all packages for now, we need to use a
# macOS runner because we have Golden Tests in some packages which requires
# a macOS runner.
#
# When the Sharezone CLI supports filters for the test command (like
# `--only="tools/sz_repo_cli"`), we can change this to a Linux runner.
runs-on: ubuntu-22.04
if: ${{ needs.changes.outputs.changesFound == 'true' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set Flutter version from FVM config file to environment variables
id: fvm-config-action
uses: kuhnroyal/flutter-fvm-config-action@4155f8ca4c30a4f2f50df69caa0e4259f6cd1142
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- name: Activate sz_repo_cli package
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(pwd)/bin >> $GITHUB_PATH
# Currently, we run the tests for all packages because we don't have a
# filter for the test command yet.
#
# Because of this, we need to exclude the golden tests because they
# require a macOS runner.
- name: Run tests via "sz test"
# We don't run the analysis in parallel to prevent
# https://github.com/SharezoneApp/sharezone-app/issues/1658.
run: |
sz test \
-c 1 \
--package-timeout-minutes 15 \
--exclude-goldens \
--only sz_repo_cli