Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: License

on:
pull_request:
push:
branches: [main]

permissions:
contents: read
pull-requests: write

jobs:
license-eye:
if: github.repository == 'version-fox/vfox-flutter'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check license headers
uses: apache/skywalking-eyes@v0.9.0
with:
config: .licenserc.yaml
- name: Check PowerShell license headers
run: docker run --rm -v "${{ github.workspace }}:/src" ghcr.io/google/addlicense:v1.2.0 -check -f .license.tpl tests/e2e/windows/*.ps1
13 changes: 13 additions & 0 deletions .license.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2026 Han Li and contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
59 changes: 59 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# License header check (Apache SkyWalking Eyes): Go and Lua are both covered.
# PowerShell is check-only here (no `<# ... #>` fix support upstream):
# tests/e2e/windows/*.ps1 is fixed and checked with addlicense instead (see
# the addlicense step in .github/workflows/license.yml and docs/e2e.md).
# CI runs the check via .github/workflows/license.yml; the local commands
# (Docker only) are documented in docs/e2e.md.
header:
license:
spdx-id: Apache-2.0
copyright-owner: Han Li and contributors
content: |
Copyright 2026 Han Li and contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comment thread
linghengqian marked this conversation as resolved.

paths-ignore:
# Documentation and data files carry no license header.
- '**/*.md'
- '**/*.yaml'
- '**/*.yml'
- '**/*.json'
- '**/*.toml'
- '**/go.mod'
- '**/go.sum'
- '**/Dockerfile*'
- '.gitignore'
- '.gitattributes'
- '.dockerignore'
- '.tool-versions'
- 'LICENSE'
# Plain-text template for addlicense (no comment markers in it; keep its
# text in sync with the `content` block above).
- '.license.tpl'

comment: on-failure
14 changes: 14 additions & 0 deletions Injection.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

--[[
Do not change any thing in the current file,
it's just there to show what objects are injected by vfox and what they do.
Expand Down
43 changes: 36 additions & 7 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ each `vfox` x `flavor` x `mirror` combination gets its own throwaway container.

## Ubuntu 26.04.1

Only Docker Engine (in either rootful or rootless mode) is required on the
host. Execute in Bash,
Only Docker Engine (in either rootful or rootless mode) is required on the host.
On ARM64 it runs the official flavor only:
OpenHarmony publishes no `linux-arm64` Dart SDK (see `docs/ohos.md`),
so the ohos flavor cannot bootstrap there.

### rootful Docker

Execute in Bash,

```bash
sudo apt install --assume-yes git
Expand All @@ -16,17 +22,18 @@ cd ./vfox-flutter/
docker compose -f tests/e2e/linux/compose.yaml run --rm e2e
```

### rootless Docker

With rootless Docker the daemon socket lives elsewhere; point `DOCKER_SOCK`
at it instead:

```bash
DOCKER_SOCK="$XDG_RUNTIME_DIR/docker.sock" \
docker compose -f tests/e2e/linux/compose.yaml run --rm e2e
sudo apt install --assume-yes git
git clone git@github.com:version-fox/vfox-flutter.git
cd ./vfox-flutter/
DOCKER_SOCK="$XDG_RUNTIME_DIR/docker.sock" docker compose -f tests/e2e/linux/compose.yaml run --rm e2e
```

On ARM64 it runs the official flavor only: OpenHarmony publishes no `linux-arm64` Dart SDK (see `docs/ohos.md`), so the
ohos flavor cannot bootstrap there.

## Windows 11 Pro

Windows containers cannot be emulated across architectures, so the ARM64 suite
Expand All @@ -47,6 +54,7 @@ winget install --id Microsoft.PowerShell --source winget --exact

```powershell
winget install --id Git.Git --source winget --exact
# Configure Git appropriately.

curl.exe -fsSL `
"https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" `
Expand Down Expand Up @@ -85,6 +93,7 @@ winget install --id Microsoft.PowerShell --source winget --exact

```powershell
winget install --id Git.Git --source winget --exact
# Configure Git appropriately.
winget install --id GoLang.Go --source winget --exact
git clone git@github.com:version-fox/vfox-flutter.git
cd ./vfox-flutter/
Expand All @@ -97,3 +106,23 @@ curl.exe -fsSL `

docker compose -f tests/e2e/windows/compose.arm64.yaml run --rm --build e2e
```

## Local checks

Execute in Bash on Ubuntu before pushing.

```bash
docker run --rm -v "$PWD:/work" -w /work apache/skywalking-eyes:0.9.0 header check
docker run --rm -v "$PWD:/work" -w /work apache/skywalking-eyes:0.9.0 header fix
docker run --rm -v "$PWD:/src" ghcr.io/google/addlicense:v1.2.0 -check -f .license.tpl tests/e2e/windows/*.ps1
docker run --rm -v "$PWD:/src" ghcr.io/google/addlicense:v1.2.0 -f .license.tpl tests/e2e/windows/*.ps1

cd tests/e2e
go test -short ./...
test -z "$(gofmt -l .)"
go vet ./...
cd ../..

stylua --check .
mise x aqua:LuaLS/lua-language-server@3.19.1 -- lua-language-server --check . --checklevel=Warning
```
14 changes: 14 additions & 0 deletions hooks/available.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local http = require("http")
local json = require("json")
local ohos = require("ohos")
Expand Down
14 changes: 14 additions & 0 deletions hooks/env_keys.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

function PLUGIN:EnvKeys(ctx)
local mainPath = ctx.path
return {
Expand Down
14 changes: 14 additions & 0 deletions hooks/pre_install.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local http = require("http")
local json = require("json")
local manifest = require("manifest")
Expand Down
14 changes: 14 additions & 0 deletions hooks/pre_use.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local manifest = require("manifest")

local REASON = {
Expand Down
14 changes: 14 additions & 0 deletions lib/git.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local HOME_ENV = "VFOX_HOME"
local FALLBACK_HOME_ENV = { "HOME", "USERPROFILE" }
local VFOX_DIR = ".vfox"
Expand Down
14 changes: 14 additions & 0 deletions lib/manifest.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local json = require("json")

local MARKER = ".vfox-manifest"
Expand Down
14 changes: 14 additions & 0 deletions lib/ohos.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local http = require("http")
local json = require("json")
local git = require("git")
Expand Down
14 changes: 14 additions & 0 deletions lib/source.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local git = require("git")

local REPO = "flutter/flutter"
Expand Down
14 changes: 14 additions & 0 deletions lib/util.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local DEFAULT_STORAGE_BASE_URL = "https://storage.googleapis.com"

function sleep(seconds)
Expand Down
14 changes: 14 additions & 0 deletions metadata.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- Copyright 2026 Han Li and contributors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

--- !!! DO NOT EDIT OR RENAME !!!
PLUGIN = {}

Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/common/common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2026 Han Li and contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Package common holds the shared logic of the Linux and Windows container
// E2E suites.
//
Expand Down
Loading
Loading