Skip to content

Commit

Permalink
(chore) Set TURBO_TOKEN for incremental remote caching
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Sep 16, 2024
1 parent 1aadc22 commit d08eb8b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 42 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ jobs:
runs-on: ubuntu-latest
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
TURBO_TOKEN: 'turbo-token'
TURBO_TEAM: ${{ github.repository_owner }}

steps:
- uses: actions/checkout@v3
- name: 📥 Checkout code
uses: actions/checkout@v3

- name: Setup a local cache server for Turborepo
- name: 🚀 Setup a local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}

- name: Compute bundle size report
- name: 📊 Compute bundle size report
uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
44 changes: 23 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
TURBO_TOKEN: 'turbo-token'
TURBO_TEAM: ${{ github.repository_owner }}

jobs:
Expand All @@ -23,35 +23,35 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Cache dependencies
- name: 💾 Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
- name: 📦 Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Setup local cache server for Turborepo
- name: 🚀 Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}

- name: Run lint, type checks and tests
- name: 🧪 Run lint, type checks and tests
run: yarn verify

- name: Run build
- name: 🏗️ Run build
run: yarn turbo run build --concurrency=5

- name: Upload build artifacts
- name: 📤 Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: packages
Expand All @@ -68,38 +68,40 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Cache dependencies
- name: 💾 Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
- name: 📦 Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Version
- name: 🏷️ Version
run: yarn workspaces foreach --worktree --topological --exclude @openmrs/esm-patient-management version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}"

- name: Build
- name: 🏗️ Build
run: yarn turbo run build --concurrency=5

- run: git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI"
- run: git add . && git commit -m "Prerelease version" --no-verify
- name: 🔧 Configure Git
run: git config user.email "info@openmrs.org" && git config user.name "OpenMRS CI"
- name: 💾 Commit changes
run: git add . && git commit -m "Prerelease version" --no-verify

- name: Pre-release
- name: 🚀 Pre-release
run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn run ci:prepublish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Upload Artifacts
- name: 📤 Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: packages
Expand All @@ -116,20 +118,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup Node.js
- name: 🟢 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Cache dependencies
- name: 💾 Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
- name: 📦 Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable

Expand All @@ -146,7 +148,7 @@ jobs:
if: ${{ github.event_name == 'push' }}

steps:
- name: Trigger RefApp Build
- name: 🔄 Trigger RefApp Build
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,75 +10,75 @@ on:

env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
TURBO_TOKEN: 'turbo-token'
TURBO_TEAM: ${{ github.repository_owner }}

jobs:
main:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repo
- name: 📥 Checkout repo
uses: actions/checkout@v4

- name: Copy test environment variables
- name: 📋 Copy test environment variables
run: cp example.env .env

- name: Setup node
- name: 🛠️ Setup node
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Cache dependencies
- name: 💾 Cache dependencies
id: cache-dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
- name: 📦 Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Get installed Playwright version
- name: 🔍 Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(grep '@playwright/test@' yarn.lock | sed -n 's/.*npm:\([^":]*\).*/\1/p' | head -n 1)" >> $GITHUB_ENV

- name: Cache playwright binaries
- name: 💾 Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright Browsers
- name: 🎭 Install Playwright Browsers
run: npx playwright install chromium --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Setup local cache server for Turborepo
- name: 🚀 Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}

- name: Build apps
- name: 🏗️ Build apps
run: yarn turbo run build --color --concurrency=5

- name: Run dev server
- name: 🖥️ Run dev server
run: bash e2e/support/github/run-e2e-docker-env.sh

- name: Wait for OpenMRS instance to start
- name: Wait for OpenMRS instance to start
run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done

- name: Run E2E tests
- name: 🧪 Run E2E tests
run: yarn playwright test

- name: Stop dev server
- name: 🛑 Stop dev server
if: '!cancelled()'
run: docker stop $(docker ps -a -q)

- name: Upload Report
- name: 📤 Upload Report
uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
1 change: 0 additions & 1 deletion packages/esm-bed-management-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"bedTagPlaceholder": "",
"bedType": "Add Bed Type",
"bedTypePlaceholder": "",
"cancel": "Cancel",
"checkFilters": "Check the filters above",
"chooseBedtype": "Choose a bed type",
"chooseOccupiedStatus": "Choose occupied status",
Expand Down

0 comments on commit d08eb8b

Please sign in to comment.