Ako/ Add github workflow equal to circle job #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | ||
on: ["push", "pull_request"] | ||
jobs: | ||
build_and_deploy: | ||
# runs-on: [self-hosted] # Specify the label of your self-hosted runner machine | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
cache-dependency-path: package-lock.json | ||
Check failure on line 14 in .github/workflows/build-and-test.yml GitHub Actions / Build and DeployInvalid workflow file
|
||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
- name: Setup Docker | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | ||
name: List the state of node modules | ||
continue-on-error: true | ||
run: npm list | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Bootstrap | ||
run: npm run bootstrap | ||
- name: Build | ||
run: npm run build:all | ||
- name: "Check TypeScript for @deriv/api" | ||
run: npx tsc --project packages/api/tsconfig.json -noEmit | ||
- name: "Check TypeScript for @deriv/hooks" | ||
run: npx tsc --project packages/hooks/tsconfig.json -noEmit | ||
- name: "Check TypeScript for @deriv/utils" | ||
run: npx tsc --project packages/utils/tsconfig.json -noEmit | ||
- name: "Check TypeScript for @deriv/analytics" | ||
run: npx tsc --project packages/analytics/tsconfig.json -noEmit | ||
- name: "Check TypeScript for @deriv/stores" | ||
run: npx tsc --project packages/stores/tsconfig.json -noEmit | ||
- name: "Check tests for @deriv/hooks" | ||
run: bash ./scripts/check-tests.sh packages/hooks/src | ||
- name: "Check tests for @deriv/utils" | ||
run: bash ./scripts/check-tests.sh packages/utils/src | ||
- name: "Check tests for @deriv/analytics" | ||
run: bash ./scripts/check-tests.sh packages/analytics/src | ||
- name: "Run tests" | ||
run: npm run test |