Skip to content
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

feat: canvaskit now offline #74

Open
wants to merge 126 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
7f9f36e
feat!: Move dev_tools client to this repo (#3)
jonas-martinez Sep 6, 2021
a7650bb
ci: Add semantic release docker
jonas-martinez Sep 7, 2021
e2729a0
ci: Fix CI for docker hub (#6)
jonas-martinez Sep 7, 2021
25de10d
ci: Set timeout for GitHub Workflow (#4)
shiipou Sep 7, 2021
c0a77c1
feat: Dockerfile combine (#9)
jonas-martinez Sep 8, 2021
103a41e
fix: Fixing CI
jonas-martinez Sep 8, 2021
672f47e
fix: Fixing CI
jonas-martinez Sep 8, 2021
dd83e86
fix: Fixing CI
jonas-martinez Sep 8, 2021
4268439
fix: Fixing CI
jonas-martinez Sep 8, 2021
123a426
fix: Fixing CI
jonas-martinez Sep 8, 2021
9108cfd
fix: Fixing CI
jonas-martinez Sep 8, 2021
e9d2857
fix: Fixing CI
jonas-martinez Sep 8, 2021
49cdf0f
fix: Fixing CI...
jonas-martinez Sep 8, 2021
018b1df
fix: Fixing CI
jonas-martinez Sep 8, 2021
53df028
fix: Fixing CI
jonas-martinez Sep 8, 2021
10eeb3a
fix: Fix docker CI & Dockerfile (#10)
jonas-martinez Sep 9, 2021
e14d28d
fix: Fix CI
jonas-martinez Sep 9, 2021
26cae79
fix: Fix server and entrypoint rights (#11)
jonas-martinez Sep 9, 2021
1412c79
docs: Update README.md (#8)
jonas-martinez Sep 13, 2021
62e15e2
fix: Added favicon rel (#13)
jonas-martinez Sep 13, 2021
5939e6b
ci: Fix docker naming (#14)
jonas-martinez Sep 15, 2021
b02fc66
ci: Add gitignore baseline, fix semantic release, add server setting …
Nesqwik Sep 28, 2021
da781a9
fix: Adapting to new version of application_runner (#16)
jonas-martinez Sep 29, 2021
fbf384b
fix: fix CI
Sep 29, 2021
6b1156b
fix: update client to beta-5
Oct 4, 2021
7d2a08f
feat: Updated client & application_runner deps to latest beta version…
Nesqwik Oct 5, 2021
be1d7d8
feat: Updated to Application Runner v 6 (#19)
jonas-martinez Oct 5, 2021
d3a0185
feat: Updated deps (#20)
jonas-martinez Oct 7, 2021
9959769
feat: Updated app-runner 8 (#21)
jonas-martinez Oct 7, 2021
cef6759
feat: Added device_preview (#23)
jonas-martinez Oct 8, 2021
d8a7175
ci: Add automatic PR on lenra's dependancy release (#22)
shiipou Oct 12, 2021
9e23b38
ci: fix github token for sementic release
shiipou Oct 12, 2021
ce4aceb
feat: deps-bot: Upgrade client to v1.0.0-beta.8 (#25)
github-actions[bot] Oct 12, 2021
d158af2
ci: fix not a git repository on reading commit message
shiipou Oct 12, 2021
ecc1276
ci: add better commit message on release
shiipou Oct 12, 2021
6252a38
fix: Fixed image component (#24)
jonas-martinez Oct 13, 2021
6d29384
ci: Build multi-arch docker image
shiipou Oct 13, 2021
2604ed3
ci: add build-args on docker build
shiipou Oct 13, 2021
ba5c063
feat: Add lenra favicon & change title (#27)
jonas-martinez Oct 13, 2021
6d57b2a
remove unecessary string strip on docker build
shiipou Oct 13, 2021
c7feb8d
ci: Use sementic release for git push
shiipou Oct 13, 2021
caac2ae
ci: use build-arg not build-args
shiipou Oct 13, 2021
f2e1220
ci: fix missing backslash on docker build
shiipou Oct 13, 2021
e59b622
ci: move arch in docker build
shiipou Oct 13, 2021
87269e9
ci: Remove incompatible riscV64
shiipou Oct 13, 2021
93b334d
ci: remove dupliqued docker build
shiipou Oct 14, 2021
ec6aa66
feat: Updated dependencies (#29)
jonas-martinez Oct 14, 2021
ba427dc
ci: add cache for docker image build
shiipou Oct 18, 2021
3299ece
ci: fix docker build multi-arch
shiipou Oct 18, 2021
e870f6c
ci: use build-arg CI
shiipou Oct 19, 2021
a48d6c1
ci: take more than 10 minutes to run
shiipou Oct 19, 2021
1bd33a1
ci: Ci take more than 15min to run
shiipou Oct 20, 2021
cc885e4
ci: fix empty release type
shiipou Oct 20, 2021
47e7178
ci: fix commit didn't trigger release
shiipou Oct 20, 2021
dcb1199
ci: fix docker login wrong image name (#30)
shiipou Oct 21, 2021
13d47d8
ci: allow lenra_ui_runner to update devtools
shiipou Nov 30, 2021
170325d
ci: regroup releases
shiipou Nov 30, 2021
3ab3b51
ci: fix client won't run release
shiipou Nov 30, 2021
bc8b484
feat: Update dependencies (#28)
github-actions[bot] Nov 30, 2021
04b34be
fix: Updated flutter for release
jonas-martinez Nov 30, 2021
649c2dc
feat: Update dependencies
jonas-martinez Dec 1, 2021
acbb606
ci: more time to build multi-image
shiipou Dec 13, 2021
f20fed2
ci: try docker login before build image to fail before using ci time
shiipou Dec 13, 2021
a501bf7
ci: fix docker login failed
shiipou Dec 14, 2021
5daeb2e
ci: Add a tag without beta number for generic beta image
shiipou Dec 27, 2021
0c25e57
ci: new docker tag using regex (#34)
shiipou Dec 28, 2021
0a07d91
feat: Update dependencies (#36)
jonas-martinez Jan 10, 2022
94209bb
ci: fix release regex that didn't pass
shiipou Jan 10, 2022
88ee0f0
ci: add "v" before version in docker image release
shiipou Jan 10, 2022
b5c0545
ci: revert last commit
shiipou Jan 10, 2022
52c3be6
ci: fix python wrong indent
shiipou Jan 20, 2022
ff739d9
ci: fix yq not working anymore after dependency update (#38)
shiipou Jan 25, 2022
bae2b4e
feat!: Upgraded devtools to match the Widget system. (#35)
Nesqwik Jan 26, 2022
f530639
ci: fix `yq` command not found
shiipou Jan 31, 2022
c896fa6
fix: Fixed NotificationListener (#40)
jonas-martinez Feb 4, 2022
3dcf835
fix: Fixed session bug (#43)
jonas-martinez Feb 4, 2022
1df28e8
feat: Update dependencies (#41)
shiipou Feb 11, 2022
7ac7496
fix: Fix ci flutter version (#46)
jonas-martinez Feb 11, 2022
2079c24
fix: Fixed release flutter version (#47)
jonas-martinez Feb 11, 2022
7be83dc
ci: upgrade lenra-io/create-or-update-pr-action
shiipou Feb 14, 2022
6d93d5c
feat: Add error handler (#49)
pichoemr Feb 21, 2022
a7ff7b1
feat: Update dependencies (#48)
shiipou Feb 22, 2022
31a6fc0
feat: Update dependencies (#50)
shiipou Mar 4, 2022
6639b2b
fix: Upgrade application_runner to v1.0.0-beta.23 (#53)
shiipou Mar 4, 2022
ae6a186
ci: change origin key from `fr_lenra_client` to `client` (#55)
shiipou Mar 9, 2022
e19f4b0
feat: Fixed SetupListeners to only call it once (#56)
jonas-martinez Mar 11, 2022
0c8d46c
ci: run `elixir_checks` only if PR is not WIP (#59)
shiipou Mar 15, 2022
b706727
ci: update `create-or-update-pr-action` to `v1.1.0` (#60)
shiipou Mar 15, 2022
fb534ff
ci: check if push is in PR test (#61)
shiipou Mar 16, 2022
3b42ac1
ci: place timeout on flutter CI (#63)
shiipou Mar 24, 2022
b1235cd
ci: add new if condition for lenra_ui_runner (#67)
shiipou Mar 25, 2022
ad573b9
feat: Update dependencies (#54)
shiipou Mar 28, 2022
e012430
ci: Update flutter (#73)
jonas-martinez Mar 28, 2022
019cb17
feat: canvaskit now offline
jonas-martinez Mar 28, 2022
1ec6e6f
ci: fix pr is wip condition on elixir run
shiipou Apr 4, 2022
abf9b4b
ci: fix pr is wip condition on flutter run
shiipou Apr 4, 2022
59227c2
ci: fix pr is wip condition on elixir run
shiipou Apr 4, 2022
43316a6
ci: update action pr-is-wip to v2.0.0
shiipou Apr 4, 2022
92460a5
ci: update action pr-is-wip to v2.0.0
shiipou Apr 4, 2022
2b14f0a
ci: fix ci pr-is-wip
shiipou Apr 11, 2022
89eff50
ci: fix ci pr-is-wip
shiipou Apr 11, 2022
8438699
ci: fix pr-is-wip
shiipou Apr 11, 2022
a3128a6
ci: fix pr-is-wip
shiipou Apr 11, 2022
61fca9a
feat: Added fonts to pubspec (#76)
jonas-martinez Apr 13, 2022
f37330e
ci: fix prIsWip
shiipou Apr 14, 2022
88f3025
ci: fix prIsWip
shiipou Apr 14, 2022
1fdd137
feat: The watchdog is now handled by the Elixir server (#65)
Nesqwik Apr 14, 2022
ae2d12c
feat: Update dependencies (#78)
shiipou Apr 22, 2022
32ef486
feat: Handle ofwatchdog reload (#80)
jonas-martinez Apr 29, 2022
b5a361c
ci: More time for release
jonas-martinez Apr 29, 2022
87e14a7
fix: remove PORT env var in template docker image (#101)
shiipou May 3, 2022
1b0d44e
ci: Typo in update dependencies (#102)
jonas-martinez May 4, 2022
34704a1
feat: Update dependencies (#98)
shiipou May 4, 2022
f1e1f4b
feat: handle new data system (#105)
pichoemr May 6, 2022
70412bc
feat: Update dependencies (#103)
shiipou May 6, 2022
ed6b7ea
feat: Update dependencies (#108)
shiipou May 10, 2022
b982f7a
feat: Upgrade client to v1.0.0-beta.64 (#109)
shiipou May 10, 2022
6dd1edf
feat: Disable device preview temporarily (#111)
jonas-martinez May 12, 2022
e31466f
feat: Update dependencies (#110)
shiipou May 12, 2022
e0acf64
feat: Update dependencies (#112)
shiipou May 13, 2022
2ecea2a
feat: Upgrade client to v1.0.0-beta.75 (#114)
shiipou May 16, 2022
e0d722a
fix: Data API Response (#113)
jonas-martinez May 18, 2022
537ca9f
feat: Upgrade client to v1.0.0-beta.76 (#115)
shiipou May 20, 2022
c123a40
Merge branch 'beta' into jonas-martinez/offline-canvas-file
jonas-martinez Jun 6, 2022
3bc5e6b
Remove canvaskit to use new solution
jonas-martinez Jun 7, 2022
a789df6
fix
jonas-martinez Jun 7, 2022
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
server/_build
server/.elixir_ls
server/deps
65 changes: 65 additions & 0 deletions .github/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

set -xe # Show output on the logs

function get_tag {
version="$1" # Get version tag
DOCKER_IMAGE="$2"

regex='([0-9]+.[0-9]+.[0-9]+)(-([a-z]+).([0-9]+))?'

if [[ $version =~ $regex ]]; then
v="${BASH_REMATCH[1]}"
channel="${BASH_REMATCH[3]}"
channel_version="${BASH_REMATCH[4]}"

tag="--tag ${DOCKER_IMAGE}:${version#v}"

regex='([0-9]+).([0-9]+).([0-9]+)'
if [[ $v =~ $regex ]]; then
major=${BASH_REMATCH[1]}
minor=${BASH_REMATCH[2]}
patch=${BASH_REMATCH[3]}

arr_version=( "${major}" "${major}.${minor}" "${major}.${minor}.${patch}" )
if [[ -n "${channel}" ]]; then
tag="${tag} --tag ${DOCKER_IMAGE}:${channel}"
for i in "${arr_version[@]}"; do
tag="${tag} --tag ${DOCKER_IMAGE}:${i}-${channel}"
done
else
tag="--tag ${DOCKER_IMAGE}:latest"
for i in "${arr_version[@]}"; do
tag="${tag} --tag ${DOCKER_IMAGE}:${i}"
done
fi
return 0
else
echo "Version '$v' didn't pass Regex '$regex'." 1>&2
return 1
fi
else
echo "Version '$version' didn't pass Regex '$regex'." 1>&2
return 1
fi
}

VERSION="$1" # Get version tag

get_tag "$VERSION" "${DOCKER_IMAGE}"
exit_code=$?
if [[ "$exit_code" != "0" ]]; then
exit $exit_code
fi

# build the docker image
docker buildx build \
--output type=image,push=true \
--platform "linux/amd64,linux/arm64" \
${tag} \
--build-arg CI=true \
--build-arg GH_PERSONNAL_TOKEN="${GITHUB_TOKEN}" \
--cache-from type=local,src=~/.docker-cache \
--cache-to type=local,dest=~/.docker-cache \
.

60 changes: 60 additions & 0 deletions .github/workflows/create_or_update_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Create or Update PR

on:
workflow_dispatch:
inputs:
version:
description: 'Lenra Component Version'
required: true
release_notes:
description: 'Lenra Component Release notes'
required: false
origin:
description: 'Label of the dependency to change version.'
required: true

jobs:
create_or_update_pr:
name: Create or Update PR
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup yq
id: setup-yq
uses: shiipou/setup-yq-action@v2.0.2
- name: create_pr
uses: lenra-io/create-or-update-pr-action@v1.1.0
with:
name: 'Update dependencies'
token: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
script: |
if [[ "${{ github.event.inputs.origin }}" == "client" ]]; then
yq eval ".dependencies.fr_lenra_client.git.ref = \"${{ github.event.inputs.version }}\"" -i client/pubspec.yaml
git add client/pubspec.yaml
elif [[ "${{ github.event.inputs.origin }}" == "lenra_ui_runner" ]]; then
yq eval ".dependencies.lenra_ui_runner.git.ref = \"${{ github.event.inputs.version }}\"" -i client/pubspec.yaml
git add client/pubspec.yaml
else
# Regex in bash is not powerful enough but thanks to python regex that work
## (I choose python because it's already installed on GitHub Action runner)
## This regex parse the private_git element of the server/mix.exs with name is application_runner and replace the tag with the requested version
python3 -c "import re
regex = re.compile(r'private_git\(\s*name\s*:\s*:${{ github.event.inputs.origin }}\s*,(?:\s|(tag:)?(?(1)\s*\"(.*)\"\s*\)|.))*')
with open ('server/mix.exs', 'r') as file :
data = str().join(file.readlines())
match = re.search(regex, data)
result = data[:match.start(2)] + '${{ github.event.inputs.version }}' + data[match.end(2):]

with open('server/mix.exs', 'w') as file:
file.writelines(str(result))
"
git add server/mix.exs
fi

RELEASE_NOTES="${{ github.event.inputs.release_notes }}"
RELEASE_TYPE="${RELEASE_NOTES/:*}"

git commit -m "${RELEASE_TYPE}: Upgrade ${{ github.event.inputs.origin }} to ${{ github.event.inputs.version }}
${RELEASE_NOTES}"
45 changes: 44 additions & 1 deletion .github/workflows/elixir_checks.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,54 @@
name: Elixir CI
on: push
on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
prIsWip:
name: PR is WIP?
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
isWip: ${{ steps.prIsWip.outputs.isWip }}
steps:
- id: prIsWip
uses: shiipou/pr-is-wip-action@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
checks:
services:
postgres:
image: postgres:12.2-alpine
env:
POSTGRES_PASSWORD: postgres
# Start in localhost
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: Checks
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- prIsWip
if: needs.prIsWip.outputs.isWip == 'false'
env:
GH_PERSONNAL_TOKEN: ${{secrets.GH_PERSONNAL_TOKEN}}
SHELL: /bin/bash
defaults:
run:
working-directory: ./server
steps:
- uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.COMPONENTS_API_SSH }}
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Flutter CI
on:
pull_request:
types:
- opened
- edited
- synchronize

env:
flutter_version: "2.10.x"
jobs:
prIsWip:
name: PR is WIP?
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
isWip: ${{ steps.prIsWip.outputs.isWip }}
steps:
- id: prIsWip
uses: shiipou/pr-is-wip-action@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Setup-Flutter:
needs:
- prIsWip
if: needs.prIsWip.outputs.isWip == 'false'
runs-on: ubuntu-latest
timeout-minutes: 3
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v2
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
- uses: subosito/flutter-action@v1.5.3
with:
flutter-version: ${{ env.flutter_version }}
- uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: |
${{ secrets.LENRA_CLIENT_SSH }}
${{ secrets.LENRA_UI_RUNNER_SSH }}
${{ secrets.LENRA_COMPONENTS_SSH }}
- name: Restore packages
run: flutter pub get

- name: Analyze
run: flutter analyze --no-congratulate

- name: Run tests
run: flutter test --coverage
# - name: Upload coverage to codecov
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/lint_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
main:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: amannn/action-semantic-pull-request@v3.4.1
env:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Populate Release

on:
release:
types: [published]

jobs:
populate_release:
name: Populate Release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
- id: extract_tag
env:
GITHUB_REF: ${{ github.ref }}
run: |
echo "Extracting tag..."
REF="${GITHUB_REF##*/}"
echo "output.tag=${REF}"
echo "::set-output name=tag::${REF}"
if [[ ${GITHUB_REF} == *beta.* ]]; then
echo "::set-output name=target_ref::beta"
else
echo "::set-output name=target_ref::main"
fi

RELEASE_NOTES="$(git log -n1 | head -n5 | tail -n1)"
RELEASE_NOTES="${RELEASE_NOTES/ /}"
echo "::set-output name=release-notes::${RELEASE_NOTES}"
- name: create_pr
uses: shiipou/workflows/trigger_workflow@main
with:
target_ref: ${{ steps.extract_tag.outputs.target_ref }}
target_repository: "${{ github.repository_owner }}/templates"
target_workflow: create_or_update_pr.yml
params: |
{
"version": "${{ steps.extract_tag.outputs.tag }}",
"origin": "dev-tools",
"release_notes": "${{ steps.extract_tag.outputs.release-notes }}"
}
token: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
57 changes: 53 additions & 4 deletions .github/workflows/semantic_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,69 @@ on:
- main
- beta
- "*.x"
env:
flutter_version: "2.10.x"
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 50
env:
GH_PERSONNAL_TOKEN: ${{secrets.GH_PERSONNAL_TOKEN}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "12"
node-version: "14"
- name: Set up Elixir
uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
elixir-version: "1.12"
otp-version: "24"
- name: Install Flutter & Dependencies
uses: subosito/flutter-action@v1.5.3
with:
flutter-version: ${{ env.flutter_version }}
- uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: |
${{ secrets.LENRA_CLIENT_SSH }}
${{ secrets.LENRA_UI_RUNNER_SSH }}
${{ secrets.LENRA_COMPONENTS_SSH }}
${{ secrets.COMPONENTS_API_SSH }}
- name: Build Flutter Web
run: |
cd client
flutter build web
cd ..
- name: Deps + compile elixir
run: |
cd server
mix deps.get
mix compile
cd ..
- name: Setup node deps
run: npm i conventional-changelog-conventionalcommits @semantic-release/exec @semantic-release/git -D
run: npm i conventional-changelog-conventionalcommits@4 @semantic-release/exec @semantic-release/git @semantic-release-plus/docker@2 -D
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache docker build
uses: actions/cache@v2
with:
path: ~/.docker-cache
key: ${{ runner.os }}-docker
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
DOCKER_IMAGE: lenra/devtools
run: npx semantic-release@18
Loading
Loading