Skip to content

Commit

Permalink
ci: run pr checks on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
AleF83 committed Dec 9, 2024
1 parent 9d3d5b0 commit 8a2a805
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 36 deletions.
44 changes: 8 additions & 36 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,12 @@ on:

workflow_dispatch:

concurrency:
group: pr-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
TILT_VERSION: '0.33.21'

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Tilt
uses: yokawasa/action-setup-kube-tools@v0.11.2
with:
setup-tools: |
tilt
tilt: ${{ env.TILT_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Run npm install
run: pnpm install --frozen-lockfile

- name: Eslint
run: pnpm run lint

- name: Run Tests
run: pnpm run tilt:ci
checks-ubuntu:
uses: ./.github/workflows/reusable-pr.yaml
with:
runner: ubuntu-latest
checks-macos:
uses: ./.github/workflows/reusable-pr.yaml
with:
runner: macos-latest
57 changes: 57 additions & 0 deletions .github/workflows/reusable-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: checks

on:
workflow_call:
inputs:
runner:
required: true
type: string

concurrency:
group: pr-${{ inputs.runner }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
TILT_VERSION: '0.33.21'

jobs:
tests:
name: Tests
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4

- name: Setup Tilt
if: ${{ inputs.runner == 'ubuntu-latest' }}
uses: yokawasa/action-setup-kube-tools@v0.11.2
with:
setup-tools: |
tilt
tilt: ${{ env.TILT_VERSION }}

- name: Set up Homebrew
if: ${{ inputs.runner == 'macos-latest' }}
uses: Homebrew/actions/setup-homebrew@master

- name: Install Tilt
if: ${{ inputs.runner == 'macos-latest' }}
run: |
brew install docker colima tilt
brew services start colima
- name: Setup pnpm
uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Run npm install
run: pnpm install --frozen-lockfile

- name: Eslint
run: pnpm run lint

- name: Run Tests
run: DOCKER_HOST="$(docker context inspect colima -f '{{ .Endpoints.docker.Host }}')" pnpm run tilt:ci

0 comments on commit 8a2a805

Please sign in to comment.