aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/builds.yml
blob: e87fc8f38fcc80e5ce62c40054987160c1afebf4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Builds

on:
  # Push to any tracked branches
  push:
    branches: [main]
  # PRs only on main branch
  pull_request:
    branches: [main]
  # Manual trigger from the UI
  workflow_dispatch:
    inputs:
      message:
        description: "Message for build"
        required: true

jobs:
  build:
    name: Ferdium Recipes Build
    runs-on: ubuntu-20.04
    steps:
      - name: Print latest commit
        run: echo ${{ github.sha }}
      - name: Set env vars
        run: echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV
      - name: Checkout code
        uses: actions/checkout@v3
      - name: Use Node.js specified in the '.nvmrc' file
        uses: actions/setup-node@v3
        with:
          node-version-file: ".nvmrc"
      - name: Install pnpm
        run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v
      - name: Install node dependencies recursively
        uses: nick-fields/retry@v2.8.2
        with:
          command: pnpm i
          timeout_minutes: 15
          max_attempts: 3
          retry_on: error
      - name: Check code style and formatting
        if: ${{ github.event_name == 'pull_request' }}
        run: pnpm lint:fix && pnpm reformat-files
      - name: Package recipes
        run: pnpm package