-
Notifications
You must be signed in to change notification settings - Fork 1
ci: verify the composite action across runner OSes #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,110 @@ | ||
| name: verify | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: ${{ matrix.os }}${{ matrix.label }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| channel: stable | ||
| flutter-version: "" | ||
| label: " / stable" | ||
| - os: macos-latest | ||
| channel: stable | ||
| flutter-version: "" | ||
| label: " / stable" | ||
| - os: windows-latest | ||
| channel: stable | ||
| flutter-version: "" | ||
| label: " / stable" | ||
| - os: ubuntu-latest | ||
| channel: beta | ||
| flutter-version: "" | ||
| label: " / beta" | ||
| - os: ubuntu-latest | ||
| channel: "" | ||
| flutter-version: "3.44.4" | ||
| label: " / pinned 3.44.4" | ||
| - os: windows-latest | ||
| channel: "" | ||
| flutter-version: "3.44.4" | ||
| label: " / pinned 3.44.4" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: ./ | ||
| with: | ||
| flutter-version: ${{ matrix.flutter-version }} | ||
| channel: ${{ matrix.channel }} | ||
|
|
||
| - name: Verify Flutter matches the requested version | ||
| shell: bash | ||
| env: | ||
| EXPECTED_CHANNEL: ${{ matrix.channel }} | ||
| EXPECTED_VERSION: ${{ matrix.flutter-version }} | ||
| run: | | ||
| flutter --version 2>&1 | tee /tmp/flutter-version.txt | ||
| if [ -n "$EXPECTED_VERSION" ]; then | ||
| grep -q "Flutter ${EXPECTED_VERSION} " /tmp/flutter-version.txt || { echo "expected Flutter $EXPECTED_VERSION" >&2; exit 1; } | ||
| else | ||
| grep -q "channel ${EXPECTED_CHANNEL}" /tmp/flutter-version.txt || { echo "expected channel $EXPECTED_CHANNEL" >&2; exit 1; } | ||
| fi | ||
|
|
||
| - name: Verify pub cache location and contents | ||
| shell: bash | ||
| run: | | ||
| echo "PUB_CACHE=$PUB_CACHE" | ||
| expected="$HOME/.pub-cache" | ||
| if [ "$RUNNER_OS" = "Windows" ]; then | ||
| expected="$LOCALAPPDATA/Pub/Cache" | ||
| fi | ||
| norm() { printf '%s' "$1" | tr '\\' '/' | tr '[:upper:]' '[:lower:]'; } | ||
| if [ "$(norm "$PUB_CACHE")" != "$(norm "$expected")" ]; then | ||
| echo "expected PUB_CACHE to be $expected" >&2 | ||
| exit 1 | ||
| fi | ||
| test -d "$PUB_CACHE" || { echo "PUB_CACHE directory missing" >&2; exit 1; } | ||
| test -d "$PUB_CACHE/hosted" || { echo "no hosted packages cached" >&2; exit 1; } | ||
|
|
||
| - name: Verify pub get resolved http from the pub cache | ||
| shell: bash | ||
| run: | | ||
| test -f .dart_tool/package_config.json | ||
| PY=python3 | ||
| command -v python3 >/dev/null 2>&1 || PY=python | ||
| "$PY" - "$PUB_CACHE" <<'EOF' | ||
| import json, os, sys, urllib.parse | ||
| pub_cache = os.path.normcase(os.path.realpath(sys.argv[1])) | ||
| base = os.path.dirname(os.path.abspath(".dart_tool/package_config.json")) | ||
| with open(".dart_tool/package_config.json") as f: | ||
| packages = json.load(f)["packages"] | ||
| http = next((p for p in packages if p["name"] == "http"), None) | ||
| assert http is not None, "http package missing from package_config.json" | ||
| root = http["rootUri"] | ||
| if "://" in root: | ||
| root = urllib.parse.urlparse(root).path | ||
| if os.name == "nt" and root.startswith("/"): | ||
| root = root[1:] | ||
| if not os.path.isabs(root): | ||
| root = os.path.join(base, root) | ||
| root = os.path.normcase(os.path.realpath(root)) | ||
| assert root.startswith(pub_cache), f"{root} not under PUB_CACHE {pub_cache}" | ||
| print(f"http resolved under PUB_CACHE ({root})") | ||
| EOF | ||
This file contains hidden or 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 @@ | ||
| .dart_tool/ | ||
| pubspec.lock | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,10 @@ | ||
| name: setup_flutter_fixture | ||
| description: Minimal Flutter fixture used by CI to verify the setup-flutter composite action. | ||
| publish_to: none | ||
| version: 0.1.0 | ||
|
|
||
| environment: | ||
| sdk: ^3.0.0 | ||
|
|
||
| dependencies: | ||
| http: ^1.2.0 |
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.
Uh oh!
There was an error while loading. Please reload this page.