-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial commit #2
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b0abced
initial commit
matthewnitschke-wk a7f2637
added aviary.yaml
matthewnitschke-wk dc43535
added version file
matthewnitschke-wk 21b961b
dart_dev cleanup
matthewnitschke-wk 5638ef9
added unit tests and fixed image name
matthewnitschke-wk e2a80af
fixed runner
matthewnitschke-wk 5353830
use snap to install yq
matthewnitschke-wk e0def47
sudo
matthewnitschke-wk f8768d8
dont use snap
matthewnitschke-wk 3d2cf92
latest yq
matthewnitschke-wk 37eb009
vprefix
matthewnitschke-wk 249fcd9
specify package path
matthewnitschke-wk e7ba7fe
doc
matthewnitschke-wk 1c4ab4c
additional working dir
matthewnitschke-wk b5e3cba
fixed used sdk version
matthewnitschke-wk 40f2965
added logging
matthewnitschke-wk f6162b2
fixed working dir
matthewnitschke-wk 2fb5407
another working dir
matthewnitschke-wk 9f5ca88
fixed test naming
matthewnitschke-wk 49a8614
dont set ln
matthewnitschke-wk e35f98e
removed dartdev
matthewnitschke-wk e1c9c95
reset naming
matthewnitschke-wk 3963cd5
fixed syntax
matthewnitschke-wk e78e997
added gha build
matthewnitschke-wk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: 🏗️ CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '**' | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, xs, al2023] | ||
steps: | ||
- uses: Workiva/[email protected] | ||
# Even though we aren't uploading a specific artifact, the | ||
# store artifacts action uploads a build.txt and marks the | ||
# github action run as "the build" for integration with | ||
# workiva release pipelines | ||
- uses: Workiva/[email protected] | ||
test: | ||
runs-on: [self-hosted, xs, al2023] | ||
steps: | ||
- uses: Workiva/[email protected] | ||
# Even though we have no test artifacts to actually upload | ||
# we need to run gha-upload-test-reports to satisfy the | ||
# auto QA pipeline rule | ||
- uses: Workiva/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 🧪 checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
paths: | ||
- __tests__/fixtures/checks/** | ||
- .github/workflows/checks.yaml | ||
- .github/workflows/_test:checks.yaml | ||
|
||
jobs: | ||
checks: | ||
uses: ./.github/workflows/checks.yaml | ||
with: | ||
package-path: __tests__/fixtures/checks | ||
|
||
checks-with-additional: | ||
uses: ./.github/workflows/checks.yaml | ||
with: | ||
package-path: __tests__/fixtures/checks | ||
additional-checks: | | ||
echo "all good!" | ||
dart format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 🧪 test-unit | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
paths: | ||
- __tests__/fixtures/test-unit/** | ||
- .github/workflows/test-unit.yaml | ||
- .github/workflows/_test:test-unit.yaml | ||
|
||
jobs: | ||
test-unit-without-chrome: | ||
uses: ./.github/workflows/test-unit.yaml | ||
with: | ||
package-path: __tests__/fixtures/test-unit/without-chrome | ||
|
||
test-unit-with-chrome: | ||
uses: ./.github/workflows/test-unit.yaml | ||
with: | ||
package-path: __tests__/fixtures/test-unit/with-chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
package-path: | ||
description: The path to the package to run checks on | ||
default: '.' | ||
type: string | ||
|
||
additional-checks: | ||
description: > | ||
Any commands to run along with the hardcoded defaults. Enter multiple | ||
commands on different lines. Failure conditions are based on if any | ||
provided command results in a non-zero exit code, OR modifies the source. | ||
type: string | ||
|
||
sdk: | ||
description: See https://github.com/dart-lang/setup-dart | ||
default: 2.19.6 | ||
type: string | ||
|
||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
- working-directory: ${{ inputs.package-path }} | ||
run: dart run dart_dev analyze | ||
|
||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
- name: Run format | ||
working-directory: ${{ inputs.package-path }} | ||
run: dart run dart_dev format --check | ||
|
||
dependency-validator: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
|
||
- name: Install Dependency Validator | ||
run: dart pub global activate dependency_validator ^3.2.3 | ||
|
||
- name: Install Package Dependencies | ||
working-directory: ${{ inputs.package-path }} | ||
run: dart pub get | ||
todbachman-wf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Run Dependency Validator | ||
working-directory: ${{ inputs.package-path }} | ||
run: dart pub global run dependency_validator | ||
|
||
analyze-additional-checks: | ||
runs-on: ubuntu-latest | ||
if: inputs.additional-checks != '' | ||
outputs: | ||
checks: ${{ steps.analyze.outputs.checks }} | ||
steps: | ||
- name: Analyze Checks | ||
id: analyze | ||
run: | | ||
checks=$(cat <<-END | ||
${{ inputs.additional-checks }} | ||
END) | ||
checks_json=$(echo "$checks" | jq -R . | jq -scM .) | ||
echo "checks=$checks_json" >> $GITHUB_OUTPUT | ||
|
||
additional-checks: | ||
runs-on: ubuntu-latest | ||
needs: analyze-additional-checks | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
check: ${{ fromJson(needs.analyze-additional-checks.outputs.checks) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
|
||
- name: Install Package Dependencies | ||
working-directory: ${{ inputs.package-path }} | ||
run: dart pub get | ||
|
||
- name: Run '${{ matrix.check }}' | ||
run: ${{ matrix.check }} | ||
working-directory: ${{ inputs.package-path }} | ||
|
||
- name: Check for source changes | ||
run: | | ||
git diff --quiet -- . ':(exclude)**pubspec.lock' || { | ||
echo "::error::The '${{ matrix.check }}' failed with source changes" | ||
git --no-pager diff -- . ':(exclude)**pubspec.lock' | ||
exit 1 | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
sdk: | ||
description: See https://github.com/dart-lang/setup-dart | ||
default: 2.19.6 | ||
type: string | ||
|
||
jobs: | ||
create-sbom-release-asset: | ||
name: Create SBOM Release Asset | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish SBOM to Release Assets | ||
uses: anchore/sbom-action@v0 | ||
with: | ||
path: ./ | ||
format: cyclonedx-json | ||
|
||
publish: | ||
name: Publish to pub.dev | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Publish - dry run | ||
run: dart pub publish --dry-run | ||
|
||
- name: Publish | ||
run: dart pub publish -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
preset: | ||
description: > | ||
Any preset to specify when running dart test, see the 'test' packages | ||
documentation on presets for more information. | ||
type: string | ||
|
||
browser-aggregation: | ||
description: > | ||
Whether or not to run the test with the --browser-aggregation flag. See test_html_builder's | ||
readme for more information: https://github.com/Workiva/test_html_builder#aggregating-browser-tests | ||
default: false | ||
type: boolean | ||
|
||
test-inputs: | ||
description: Optional path(s) to a specific test file(s) passed to the dart test command | ||
type: string | ||
|
||
test-args: | ||
description: Arguments passed directly to the dart test command | ||
type: string | ||
|
||
package-path: | ||
description: A path to the package to run unit tests against | ||
type: string | ||
default: '.' | ||
|
||
timeout: | ||
description: A timeout, specificed in minutes, for the dart test command | ||
default: 15 | ||
type: number | ||
|
||
sdk: | ||
description: See https://github.com/Workiva/gha-dart/blob/master/setup-dart/README.md | ||
default: 2.19.6 | ||
type: string | ||
|
||
jobs: | ||
pre: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
has-chrome-platform: ${{ steps.analyze.outputs.HAS_CHROME_PLATFORM }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install yq | ||
run: | | ||
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.43.1/yq_linux_amd64 | ||
sudo chmod +x /usr/local/bin/yq | ||
- working-directory: ${{ inputs.package-path }} | ||
id: analyze | ||
run: | | ||
if [[ -f 'dart_test.yaml' ]]; then | ||
platforms=$(yq '.platforms[], .presets.*.platforms[]' dart_test.yaml) | ||
|
||
if [[ "$platforms" == *"chrome"* ]]; then | ||
echo "Project has chrome platform config" | ||
echo "HAS_CHROME_PLATFORM=true" >> $GITHUB_OUTPUT | ||
exit 0 | ||
fi | ||
fi | ||
echo "Project does not have chrome platform config" | ||
echo "HAS_CHROME_PLATFORM=false" >> $GITHUB_OUTPUT | ||
|
||
unit: | ||
runs-on: ubuntu-latest | ||
needs: pre | ||
name: ${{ matrix.release-mode && 'dev' || 'release' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
release-mode: ${{ fromJson(needs.pre.outputs.has-chrome-platform == 'true' && '[true, false]' || '[false]') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dart-lang/setup-dart@v1 | ||
with: | ||
sdk: ${{ inputs.sdk }} | ||
|
||
- name: Setup Chrome | ||
if: needs.pre.outputs.has-chrome-platform == 'true' | ||
uses: browser-actions/setup-chrome@v1 | ||
with: | ||
chrome-version: stable | ||
- name: Setup Chrome Alias | ||
if: needs.pre.outputs.has-chrome-platform == 'true' | ||
run: alias google-chrome="/opt/hostedtoolcache/chromium/stable/x64/chrome" | ||
|
||
- name: Pub get | ||
working-directory: ${{ inputs.package-path }} | ||
run: dart pub get | ||
|
||
- name: Run dart_dev unit tests | ||
working-directory: ${{ inputs.package-path }} | ||
run: | | ||
args=() | ||
if [[ "${{ matrix.release-mode }}" == "true" ]]; then | ||
args+=(--release) | ||
fi | ||
|
||
if [[ "${{ inputs.browser-aggregation }}" == "true" ]]; then | ||
args+=(--browser-aggregation) | ||
fi | ||
|
||
if [[ "${{ inputs.preset }}" != "" ]]; then | ||
args+=(-P ${{ inputs.preset }}) | ||
fi | ||
|
||
if [[ "${{ inputs.test-args }}" != "" ]]; then | ||
args+=(--test-args="${{ inputs.test-args }}") | ||
fi | ||
|
||
timeout ${{ inputs.timeout }}m dart run dart_dev test "${args[@]}" ${{ inputs.test-inputs }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pubspec.lock | ||
.dart_tool |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok these 2 jobs are running on self-hosted runners?