Skip to content

Commit

Permalink
Checkout memos-upstream to v0.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthalles committed Nov 18, 2023
2 parents abd72fc + 6bff3e2 commit ed8971a
Show file tree
Hide file tree
Showing 590 changed files with 20,975 additions and 52,897 deletions.
1 change: 0 additions & 1 deletion memos-upstream/.github/ISSUE_TEMPLATE/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion memos-upstream/.github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest an idea for memos!
Thanks for taking the time to suggest an idea for Memos!
- type: textarea
attributes:
label: Is your feature request related to a problem?
Expand Down
24 changes: 9 additions & 15 deletions memos-upstream/.github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
name: Backend Test

on:
push:
branches: [main]
pull_request:
branches:
- main
- "release/*.*.*"
paths:
- "go.mod"
- "go.sum"
- "**.go"

jobs:
go-static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.19
check-latest: true
cache: true
- name: Verify go.mod is tidy
run: |
go mod tidy -go=1.21
go mod tidy -go=1.19
git diff --exit-code
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.1
args: --verbose --timeout=3m
version: v1.52.0
args: -v --timeout=3m
skip-cache: true

go-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.19
check-latest: true
cache: true
- name: Run all tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
type=raw,value=latest
type=semver,pattern={{version}},value=${{ env.VERSION }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
type=semver,pattern={{major}},value=${{ env.VERSION }}
- name: Build and Push
id: docker_build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down
14 changes: 4 additions & 10 deletions memos-upstream/.github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
paths:
- "go.mod"
- "go.sum"
- "**.go"
- "proto/**"
- "web/**"

jobs:
analyze:
Expand All @@ -42,11 +36,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -57,7 +51,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -71,4 +65,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v1
66 changes: 66 additions & 0 deletions memos-upstream/.github/workflows/e2e-test.yml
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)
16 changes: 4 additions & 12 deletions memos-upstream/.github/workflows/frontend-tests.yml
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
34 changes: 0 additions & 34 deletions memos-upstream/.github/workflows/proto-linter.yml

This file was deleted.

85 changes: 85 additions & 0 deletions memos-upstream/.github/workflows/uffizzi-build.yml
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
Loading

0 comments on commit ed8971a

Please sign in to comment.