Skip to content

Commit

Permalink
Merge pull request #121 from ueckoken/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Azuki-bar authored Oct 21, 2022
2 parents dee27aa + caf2672 commit e8c5eeb
Show file tree
Hide file tree
Showing 178 changed files with 6,938 additions and 2,051 deletions.
36 changes: 31 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
internal:
- backend/internal/**/*
- any:
- backend/internal/**
- "!backend/internal/spec/**"
external:
- backend/external/**/*
frontend:
- frontend/**/*
- any:
- backend/external/**
- "!backend/external/spec/**"
positioning:
- any:
- "backend/positioning/**"
- "!backend/positioning/spec/**"
speed:
- any:
- "backend/speed/**"
- "!backend/speed/spec/**"
ats:
- any:
- "backend/ats/**"
- "!backend/ats/spec/**"
multicaster:
- any:
- "backend/multicaster/**"
momo_sender:
- any:
- "frontend/momo_sender/**"
skyway_receiver:
- any:
- "frontend/skyway_receiver/**"
site:
- any:
- "frontend/site/**"
ci-cd:
- .github/**/*
- manifests/**/*
documentation:
- README.md
- '**/docs/**/*.md'
- "**/docs/**/*.md"
44 changes: 20 additions & 24 deletions .github/workflows/compile-protocol-buffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up Node in ats
uses: actions/setup-node@v3
with:
node-version: 16
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand All @@ -27,31 +30,24 @@ jobs:
echo "$RUNNER_TEMP/protoc/bin" >> $GITHUB_PATH
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: run protoc
- name: prepare protoc
run: |-
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.19.0/protoc-3.19.0-linux-x86_64.zip -o $RUNNER_TEMP/protoc.zip
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.20.3/protoc-3.20.3-linux-x86_64.zip -o $RUNNER_TEMP/protoc.zip
unzip -d $RUNNER_TEMP/protoc $RUNNER_TEMP/protoc.zip
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
mkdir -p $GITHUB_WORKSPACE/backend/internal/spec
mkdir -p $GITHUB_WORKSPACE/backend/external/spec
cd $GITHUB_WORKSPACE/backend/
mkdir -p $GITHUB_WORKSPACE/backend/ats/spec
- name: prepare node protoc
run: |-
yarn install --frozen-lockfile
working-directory: backend/ats
- name: gen proto
run: |-
make pb
- name: Count changes
id: changes
run: |
# https://zenn.dev/snowcait/articles/18c9137f49e378#%E6%96%B9%E6%B3%95-2-%3A-jobs.%3Cjob_id%3E.steps.if
git add -N . # 新規ファイルを含める
echo "::set-output name=count::$(git diff --name-only | wc -l)"
- name: commit & push
run: |
git config --global user.name 'GITHUB ACTION BOT'
git config --global user.email '[email protected]'
git add .
git commit -m "Update"
git push
if: steps.changes.outputs.count > 0
working-directory: backend/
- name: Add & Commit
uses: EndBug/[email protected]
with:
default_author: github_actions
6 changes: 3 additions & 3 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy WebRTC

defaults:
run:
working-directory: ./frontend/
working-directory: ./frontend/site

on:
push:
Expand All @@ -28,8 +28,8 @@ jobs:
- name: Build
uses: docker/build-push-action@v3
with:
context: ./frontend
file: ./frontend/Dockerfile
context: ./frontend/site
file: ./frontend/site/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/ueckoken/plarail2022-frontend:${{ env.IMAGE_TAG }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Deploy WebRTC python server

defaults:
run:
working-directory: ./frontend/videoCast
working-directory: ./backend/multicaster

on:
push:
branches: [deployment]
paths: ["./frontend/videoCast/**"]
paths: ["./backend/multicaster/**"]

jobs:
build:
Expand All @@ -30,8 +30,8 @@ jobs:
- name: Build
uses: docker/build-push-action@v3
with:
context: ./frontend/videoCast
file: ./frontend/videoCast/Dockerfile.python
context: ./backend/multicaster
file: ./backend/multicaster/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/ueckoken/plarail2022-frontend-python:${{ env.IMAGE_TAG }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-sender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy WebRTC sender

defaults:
run:
working-directory: ./frontend/
working-directory: ./frontend/momo_sender

on:
push:
Expand All @@ -29,8 +29,8 @@ jobs:
- name: Build
uses: docker/build-push-action@v3
with:
context: ./frontend/videoCast/
file: ./frontend/videoCast/Dockerfile.sender
context: ./frontend/momo_sender/
file: ./frontend/momo_sender/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/ueckoken/plarail2022-webrtc-sender:${{ env.IMAGE_TAG }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-testing-receiver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy WebRTC receiver testing

defaults:
run:
working-directory: ./frontend/
working-directory: ./frontend/skyway_receiver

on:
push:
Expand Down Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Build
uses: docker/build-push-action@v3
with:
context: ./frontend/videoCast/
file: ./frontend/videoCast/Dockerfile.receiver
context: ./frontend/skyway_receiver/
file: ./frontend/skyway_receiver/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/ueckoken/plarail2022-receiver-test:${{ env.IMAGE_TAG }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
paths:
- "frontend/**/*"
- "backend/multicaster/*"
branches-ignore:
- "main"
- "deployment"
Expand All @@ -13,15 +14,15 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "frontend/"
working-directory: "frontend/site"
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ./frontend/.nvmrc
node-version-file: ./frontend/site/.nvmrc
cache: yarn
cache-dependency-path: ./frontend/yarn.lock
cache-dependency-path: ./frontend/site/yarn.lock
- run: yarn install --frozen-lockfile
- run: yarn fmt
- name: Count changes
Expand All @@ -38,19 +39,19 @@ jobs:
git push
if: steps.changes.outputs.count > 0

prettier-videocast:
prettier-momo-sender:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "frontend/videoCast"
working-directory: "frontend/momo_sender"
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ./frontend/videoCast/.nvmrc
node-version-file: ./frontend/momo_sender/.nvmrc
cache: npm
cache-dependency-path: ./frontend/videoCast/package-lock.json
cache-dependency-path: ./frontend/momo_sender/package-lock.json
- run: npm ci
- run: npm run fmt
- uses: EndBug/add-and-commit@v9
Expand All @@ -59,19 +60,40 @@ jobs:
author_email: [email protected]
message: format by prettier

black-videoCast:
prettier-skyway-receiver:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "frontend/videoCast"
working-directory: "frontend/skyway_receiver"
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ./frontend/skyway_receiver/.nvmrc
cache: npm
cache-dependency-path: ./frontend/skyway_receiver/package-lock.json
- run: npm ci
- run: npm run fmt
- uses: EndBug/add-and-commit@v9
with:
author_name: format BOT
author_email: [email protected]
message: format by prettier

black-multicaster:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "backend/multicaster"
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version-file: ./backend/multicaster/.python-version
cache: pip
cache-dependency-path: ./frontend/videoCast/requirements-dev.txt
cache-dependency-path: ./backend/multicaster/requirements-dev.txt
- run: pip install -r requirements-dev.txt
- run: black .
- uses: EndBug/add-and-commit@v9
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Frontend build and test

defaults:
run:
working-directory: ./frontend
working-directory: ./frontend/site

on: push

Expand All @@ -14,13 +14,13 @@ jobs:
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('./frontend/**/yarn.lock') }}-${{ hashFiles('./frontend/**.[jt]s', './frontend/**.[jt]sx') }}
${{ github.workspace }}/frontend/site/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('./frontend/site/**/yarn.lock') }}-${{ hashFiles('./frontend/site/**.[jt]s', './frontend/site/**.[jt]sx') }}
- uses: actions/setup-node@v3
with:
node-version-file: ./frontend/.nvmrc
node-version-file: ./frontend/site/.nvmrc
cache: yarn
cache-dependency-path: ./frontend/yarn.lock
cache-dependency-path: ./frontend/site/yarn.lock
- name: dependency-install
run: yarn install --frozen-lockfile --immutable
- name: lint
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test-multicaster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Multicaster test

defaults:
run:
working-directory: ./backend/multicaster

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version-file: ./backend/multicaster/.python-version
cache: pip
cache-dependency-path: ./backend/multicaster/requirements-dev.txt
- run: pip install -r requirements-dev.txt
- name: Type check
run: mypy .
31 changes: 31 additions & 0 deletions .github/workflows/test-positioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: positioning build and test

defaults:
run:
working-directory: ./backend/positioning

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: ./backend/positioning/go.mod
cache: true
cache-dependency-path: ./backend/positioning/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
working-directory: ./backend/positioning/
- name: Build Go binary
run: |-
make build
- name: Run Go Test
run: |-
make test
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: WebRTC receiver and sender build test
name: WebRTC sender build test

defaults:
run:
working-directory: ./frontend/videoCast
working-directory: ./frontend/momo_sender

on: push

Expand All @@ -13,9 +13,9 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ./frontend/videoCast/.nvmrc
node-version-file: ./frontend/momo_sender/.nvmrc
cache: npm
cache-dependency-path: ./frontend/videoCast/package-lock.json
cache-dependency-path: ./frontend/momo_sender/package-lock.json
- name: dependency-install
run: npm ci
- name: build
Expand Down
Loading

0 comments on commit e8c5eeb

Please sign in to comment.