You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.2 KiB
YAML
111 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
env:
|
|
CI: true
|
|
YARN_ENABLE_IMMUTABLE_INSTALLS: 'false'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
LICENSE_KEY: ${{ secrets.MAXMIND_KEY }}
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14.x
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
- uses: actions/cache@v3
|
|
id: yarn-cache
|
|
with:
|
|
path: |
|
|
${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
yarn.lock
|
|
**/tsconfig.tsbuildinfo
|
|
key: yarn-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
yarn-
|
|
- name: Config And Install
|
|
run: |
|
|
[[ ! -z "${{secrets.NPM_TOKEN}}" ]] && echo "npmAuthToken: ${{secrets.NPM_TOKEN}}" >> .yarnrc.yml
|
|
git config --global user.name undefined
|
|
git config --global user.email i@undefined.moe
|
|
yarn
|
|
- name: Build And Lint
|
|
run: |
|
|
yarn build:ui:gulp
|
|
parallel --tty -j+0 yarn ::: lint:ci lint:ui:ci build build:ui:production:webpack test
|
|
- name: Publish
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: node build/publish.js
|
|
# - name: Benchmark
|
|
# run: yarn benchmark
|
|
# - name: Benchmark result
|
|
# uses: benchmark-action/github-action-benchmark@v1
|
|
# with:
|
|
# name: Benchmark
|
|
# tool: customBiggerIsBetter
|
|
# output-file-path: benchmark.json
|
|
# web:
|
|
# needs: build
|
|
# permissions:
|
|
# packages: write
|
|
# contents: read
|
|
# runs-on: ubuntu-latest
|
|
# if: ${{ github.event_name == 'push' }}
|
|
# steps:
|
|
# - name: Check out
|
|
# uses: actions/checkout@v2
|
|
# with:
|
|
# submodules: recursive
|
|
# - name: Log in to GitHub Docker Registry
|
|
# uses: docker/login-action@v1
|
|
# with:
|
|
# registry: docker.pkg.github.com
|
|
# username: ${{ github.actor }}
|
|
# password: ${{ secrets.GITHUB_TOKEN }}
|
|
# - name: Docker:Web
|
|
# uses: docker/build-push-action@v2
|
|
# with:
|
|
# push: true
|
|
# context: ./install/docker/backend
|
|
# tags: |
|
|
# docker.pkg.github.com/hydro-dev/web:${{ github.sha }}
|
|
# docker.pkg.github.com/hydro-dev/web:${{ github.ref }}
|
|
# judge:
|
|
# needs: build
|
|
# if: ${{ github.event_name == 'push' }}
|
|
# permissions:
|
|
# packages: write
|
|
# contents: read
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Check out
|
|
# uses: actions/checkout@v2
|
|
# with:
|
|
# submodules: recursive
|
|
# - name: Log in to GitHub Docker Registry
|
|
# uses: docker/login-action@v1
|
|
# with:
|
|
# registry: docker.pkg.github.com
|
|
# username: ${{ github.actor }}
|
|
# password: ${{ secrets.GITHUB_TOKEN }}
|
|
# - name: Docker:Judge
|
|
# uses: docker/build-push-action@v2
|
|
# with:
|
|
# push: true
|
|
# context: ./install/docker/judge
|
|
# tags: |
|
|
# docker.pkg.github.com/hydro-dev/judge:${{ github.sha }}
|
|
# docker.pkg.github.com/hydro-dev/judge:${{ github.ref }} |