Skip to content

Commit

Permalink
ci(lint&test): add build test(GUI)
Browse files Browse the repository at this point in the history
  • Loading branch information
SARDONYX-sard committed Nov 16, 2023
1 parent e601651 commit 08a6551
Showing 1 changed file with 48 additions and 5 deletions.
53 changes: 48 additions & 5 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Cargo Lint & Test

on:
push:
branches: ["main"]
branches: ['main']
pull_request:
branches: "*"
branches: '*'

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -39,6 +39,49 @@ jobs:
run: |
rustup component add clippy
rustup component add rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace -- -D warnings
- run: cargo test --workspace
- name: Format Check
run: cargo fmt --all -- --check
- name: Lint Check
run: cargo clippy --workspace -- -D warnings
- name: Core Test
run: cargo test --workspace

- name: Sync node version
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install frontend dependencies
run: npm install

- name: Setup cache
uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Test(GUI)
run: npm test
- name: Build Test(GUI)
run: npm run build

- name: Compress output(Windows)
shell: pwsh
if: ${{ runner.os }} == 'Windows'
run: Compress-Archive ${{ github.workspace}}/target/debug/g_dar2oar.exe ./gui/g_dar2oar-${{ runner.os}}.zip
- name: Compress output(Unix)
shell: bash
if: ${{ runner.os }} != 'Windows'
run: tar -czvf ./gui/g_dar2oar-${{ runner.os}}.tar.gz ${{ github.workspace}}/target/debug/g_dar2oar

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
with:
name: DAR to OAR Converter(GUI)-${{runner.os}}
path: |
${{ github.workspace}}/gui/

0 comments on commit 08a6551

Please sign in to comment.