mirror of
https://github.com/selfxyz/self.git
synced 2026-02-19 02:24:25 -05:00
Add GitHub Actions workflow for building and testing the app
This commit is contained in:
35
.github/actions/yarn-install/action.yml
vendored
Normal file
35
.github/actions/yarn-install/action.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Yarn Install
|
||||
|
||||
description: Install Yarn v4 and run yarn install.
|
||||
|
||||
inputs:
|
||||
working_directory:
|
||||
description: The directory to install dependencies in.
|
||||
required: false
|
||||
default: "."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Install Yarn v4
|
||||
shell: bash
|
||||
run: |
|
||||
corepack enable
|
||||
corepack prepare yarn@4.5.0 --activate
|
||||
- name: Cache Yarn dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
${{ inputs.working_directory }}/node_modules
|
||||
~/.cache/yarn
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('${{ inputs.working_directory }}/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: yarn install --immutable
|
||||
working-directory: ${{ inputs.working_directory }}
|
||||
40
.github/workflows/app.yml
vendored
Normal file
40
.github/workflows/app.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: App CI
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "app/**"
|
||||
- ".github/workflows/app.yml"
|
||||
- ".github/actions/**"
|
||||
|
||||
jobs:
|
||||
install:
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
with:
|
||||
working_directory: ./app
|
||||
|
||||
lint:
|
||||
needs: install
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run linter
|
||||
run: yarn lint
|
||||
working-directory: ./app
|
||||
- name: Run prettier
|
||||
run: yarn fmt
|
||||
working-directory: ./app
|
||||
|
||||
test:
|
||||
needs: install
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install app dependencies
|
||||
run: yarn install-app
|
||||
working-directory: ./app
|
||||
- name: Test
|
||||
run: yarn test
|
||||
working-directory: ./app
|
||||
Reference in New Issue
Block a user