Skip to content

Commit

Permalink
Track flutter version in a file
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardGomezEscandell committed Oct 5, 2023
1 parent f355c7d commit 61ac921
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 8 deletions.
29 changes: 29 additions & 0 deletions .github/actions/load-json/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Load JSON
description: Loads JSON data from a file.

inputs:
path:
required: true
description: "Path to the JSON file"

outputs:
data:
description: "Loaded data. Can be accessed like a Github matrix."
value: ${{ fromJson(steps.load.outputs.data) }}

runs:
using: "composite"
steps:
- name: Load JSON
id: load
shell: bash
run : |
# Load JSON from ${{ inputs.path }}
set -eu
data=$(cat '${{ inputs.path }}')
# Remove endlines
data="${data//[$'\r\n']}"
# Store result (must be in a single line)
echo "versions='$data'" >> $GITHUB_OUTPUT
10 changes: 7 additions & 3 deletions .github/workflows/qa-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
env:
az_name: wsl-ci-3
az_resource_group: wsl
flutter-version: 3.13.x

jobs:
build-wsl-pro-service:
Expand Down Expand Up @@ -43,10 +42,15 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version-file: go.work
- name: Load flutter version
id: load
uses: ./.github/actions/load-json
with:
path: tools/versions.json
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ env.flutter-version }}
flutter-version: ${{ steps.load.outputs.data.flutter-version }}
- name: Setup MSBuild (PATH)
uses: microsoft/[email protected]
- name: Install certificate
Expand Down Expand Up @@ -170,7 +174,7 @@ jobs:
# Uninstall Appx
Get-AppxPackage -Name "CanonicalGroupLimited.UbuntuProForWindows" | Remove-AppxPackage -ErrorAction Ignore
# Uninstall certificate
$thumbprint = (Get-PfxCertificate -FilePath "ci-artifacts\windows-agent\UbuntuProForWindows_*.cer").Thumbprint
Remove-Item -Path "Cert:LocalMachine\TrustedPeople\${thumbprint}"
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ concurrency:
group: QA-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
flutter-version: 3.13.x

jobs:
quality-go:
name: "Go Quality checks"
Expand Down Expand Up @@ -118,10 +115,15 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: windows-agent/go.mod
- name: Load flutter version
id: load
uses: ./.github/actions/load-json
with:
path: tools/versions.json
- name: Flutter QA
uses: ./.github/actions/flutter-qa/
with:
flutter-version: ${{ env.flutter-version }}
flutter-version: ${{ steps.load.outputs.data.flutter-version }}
package-dir: '${{ matrix.package }}'
run-build-runner: ${{ contains(matrix.package, 'ubuntupro') }}
- uses: ./.github/actions/check-diff
Expand Down Expand Up @@ -151,10 +153,15 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev unzip xvfb
- name: Check out repository
uses: actions/checkout@v4
- name: Load flutter version
id: load
uses: ./.github/actions/load-json
with:
path: tools/versions.json
- name: Flutter QA
uses: ./.github/actions/flutter-integration-test/
with:
flutter-version: ${{ env.flutter-version }}
flutter-version: ${{ steps.load.outputs.data.flutter-version }}
go-version-file: windows-agent/go.mod
# Only the app entry point is expected to have integration tests
package-dir: 'gui/packages/ubuntupro'
Expand Down
4 changes: 4 additions & 0 deletions tools/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"doc": "This doument is used by the CI to track versions that cannot be tracked by Go.",
"flutter-version": "3.13.x"
}

0 comments on commit 61ac921

Please sign in to comment.