diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 083c819..f4429d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,6 @@ on: branches: ['main'] pull_request: branches: ['main'] - workflow_dispatch: jobs: @@ -13,18 +12,64 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 with: node-version: 16 - cache: 'yarn' - - name: Install deps + - name: Install global dependencies run: | npm install --global yarn - yarn install + git config --global user.email "ci@example.com" + git config --global user.name "CI" + + # Core project + - name: Get core yarn cache directory path + id: core-yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Cache core yarn cache + uses: actions/cache@v3 + id: core-yarn-cache + with: + path: ${{ steps.core-yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-core-${{ hashFiles('core/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-core- + + - name: Install dependencies in core + run: | + cd core + HUSKY=0 yarn install --frozen-lockfile - - name: Yarn lint - run: yarn run lint \ No newline at end of file + # LBA project + - name: Get lba yarn cache directory path + id: lba-yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Cache lba yarn cache + uses: actions/cache@v3 + id: lba-yarn-cache + with: + path: ${{ steps.lba-yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-lba-${{ hashFiles('lba/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-lba- + + - name: Install dependencies in lba + run: | + cd lba + HUSKY=0 yarn install --frozen-lockfile + + - name: Run lint in core + run: | + cd core + yarn run lint + + - name: Run lint in lba + run: | + cd lba + yarn run lint \ No newline at end of file