Skip to content

Commit

Permalink
ci: basic pipeline setup
Browse files Browse the repository at this point in the history
  • Loading branch information
szattila98 committed Jun 30, 2023
1 parent c686f53 commit 8096e6b
Show file tree
Hide file tree
Showing 10 changed files with 3,735 additions and 42 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Rust

on:
push:
branches: ["main"]
paths:
- "server/**"
pull_request:
branches: ["**"]
types: [opened, synchronize]
paths:
- "server/**"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Server Check
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Setup rust cache
uses: Swatinem/rust-cache@v2.2.0
with:
shared-key: whooosh
workspaces: server

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path server/Cargo.toml

test:
name: Server Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Setup rust cache
uses: Swatinem/rust-cache@v2.2.0
with:
shared-key: whooosh
workspaces: server

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path server/Cargo.toml

lints:
name: Server Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Setup rust cache
uses: Swatinem/rust-cache@v2.2.0
with:
shared-key: whooosh
workspaces: server

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path server/Cargo.toml -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path server/Cargo.toml -- -D warnings
43 changes: 43 additions & 0 deletions .github/workflows/vue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Vue

on:
push:
branches: ["main"]
paths:
- "client/**"
pull_request:
branches: ["**"]
types: [opened, synchronize]
paths:
- "client/**"
workflow_dispatch:

jobs:
build:
name: Build and Check Client
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Check Styling
run: npm run lint

- name: Build
run: npm run build
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["vue.volar", "rust-lang.rust-analyzer"]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.workingDirectories": ["./client"],
"files.insertFinalNewline": true
}
5 changes: 5 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: [
'@nuxtjs/eslint-config-typescript'
]
}
5 changes: 4 additions & 1 deletion client/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true }
devtools: { enabled: true },
modules: [
'@nuxtjs/eslint-module'
]
})
Loading

0 comments on commit 8096e6b

Please # to comment.