Skip to content

Commit

Permalink
Add Control Station and Pod Operation GitHub workflows (#15)
Browse files Browse the repository at this point in the history
* feat: github workflows
* feat: add npm run build
* Use 'run: cargo ...' instead of cargo action
* Install Prettier
* Use dtolnay/rust-toolchain in place of actions-rs
  • Loading branch information
samderanova authored Feb 24, 2024
1 parent e950060 commit f4b0d52
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/run-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Run Checks

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
check-control-station:
name: Check Control Station
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./control-station
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install frontend dependencies
run: npm install

- name: Format with Prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:
workdir: control-station/
level: warning
reporter: github-pr-review
prettier_flags: src

- name: Lint with ESLint (review)
uses: reviewdog/action-eslint@v1
if: github.event_name == 'pull_request'
with:
workdir: control-station/
level: error
reporter: github-pr-review
eslint_flags: src

- name: Lint with ESLint (check)
uses: reviewdog/action-eslint@v1
if: github.event_name == 'push'
with:
workdir: control-station/
level: error
reporter: github-check
eslint_flags: src

- name: Test building
run: npm run build

check-pod-operation:
name: Check Pod Operation
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pod-operation
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Get Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Run cargo test
run: cargo test

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Lint pod operation
run: cargo clippy -- -D warnings

- name: Build Pod Operation Program
run: cargo build
16 changes: 16 additions & 0 deletions control-station/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions control-station/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"prettier": "3.2.5",
"typescript": "^5.0.2",
"vite": "^4.4.5"
}
Expand Down

0 comments on commit f4b0d52

Please sign in to comment.