-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
590 changed files
with
20,975 additions
and
52,897 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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,66 @@ | ||
name: "E2E Test" | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
build: | ||
name: Build and Run Memos With E2E Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Docker image | ||
id: docker_build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./ | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
push: false | ||
tags: neosmemo/memos:e2e | ||
labels: neosmemo/memos:e2e | ||
|
||
- name: Run Docker container | ||
run: docker run -d -p 5230:5230 neosmemo/memos:e2e | ||
|
||
- uses: pnpm/action-setup@v2.2.4 | ||
with: | ||
version: 8.0.0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
cache-dependency-path: ./web/pnpm-lock.yaml | ||
|
||
- name: Install dependencies | ||
working-directory: web | ||
run: pnpm install | ||
|
||
- name: Install Playwright Browsers | ||
working-directory: web | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run Playwright tests | ||
working-directory: web | ||
run: npx playwright test | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: web/playwright-report/ | ||
retention-days: 30 | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-screenshot | ||
path: web/playwright-screenshot/ | ||
retention-days: 30 | ||
|
||
- name: Stop Docker container | ||
run: docker stop $(docker ps -q) |
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 |
---|---|---|
@@ -1,52 +1,44 @@ | ||
name: Frontend Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: | ||
- main | ||
- "release/*.*.*" | ||
paths: | ||
- "web/**" | ||
|
||
jobs: | ||
eslint-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2.2.4 | ||
with: | ||
version: 8 | ||
version: 8.0.0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
cache: pnpm | ||
cache-dependency-path: "web/pnpm-lock.yaml" | ||
- run: pnpm install | ||
working-directory: web | ||
- run: pnpm type-gen | ||
working-directory: web | ||
- name: Run eslint check | ||
run: pnpm lint | ||
working-directory: web | ||
|
||
frontend-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2.2.4 | ||
with: | ||
version: 8 | ||
version: 8.0.0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
cache: pnpm | ||
cache-dependency-path: "web/pnpm-lock.yaml" | ||
- run: pnpm install | ||
working-directory: web | ||
- run: pnpm type-gen | ||
working-directory: web | ||
- name: Run frontend build | ||
run: pnpm build | ||
working-directory: web |
This file was deleted.
Oops, something went wrong.
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,85 @@ | ||
name: Build PR Image | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
|
||
jobs: | ||
build-memos: | ||
name: Build and push `Memos` | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tags: ${{ steps.meta.outputs.tags }} | ||
if: ${{ github.event.action != 'closed' }} | ||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Generate UUID image name | ||
id: uuid | ||
run: echo "UUID_WORKER=$(uuidgen)" >> $GITHUB_ENV | ||
|
||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: registry.uffizzi.com/${{ env.UUID_WORKER }} | ||
tags: | | ||
type=raw,value=60d | ||
- name: Build and Push Image to registry.uffizzi.com - Uffizzi's ephemeral Registry | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./ | ||
file: Dockerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha, mode=max | ||
|
||
render-compose-file: | ||
name: Render Docker Compose File | ||
# Pass output of this workflow to another triggered by `workflow_run` event. | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-memos | ||
outputs: | ||
compose-file-cache-key: ${{ steps.hash.outputs.hash }} | ||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v3 | ||
- name: Render Compose File | ||
run: | | ||
MEMOS_IMAGE=${{ needs.build-memos.outputs.tags }} | ||
export MEMOS_IMAGE | ||
# Render simple template from environment variables. | ||
envsubst < docker-compose.uffizzi.yml > docker-compose.rendered.yml | ||
cat docker-compose.rendered.yml | ||
- name: Upload Rendered Compose File as Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: preview-spec | ||
path: docker-compose.rendered.yml | ||
retention-days: 2 | ||
- name: Upload PR Event as Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: preview-spec | ||
path: ${{github.event_path}} | ||
retention-days: 2 | ||
|
||
delete-preview: | ||
name: Call for Preview Deletion | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.action == 'closed' }} | ||
steps: | ||
# If this PR is closing, we will not render a compose file nor pass it to the next workflow. | ||
- name: Upload PR Event as Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: preview-spec | ||
path: ${{github.event_path}} | ||
retention-days: 2 |
Oops, something went wrong.