Skip to content

Commit

Permalink
changes in github workflows8
Browse files Browse the repository at this point in the history
  • Loading branch information
Isthisanmol committed Apr 11, 2024
1 parent 96db9a0 commit bb960cc
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: android-build-apk
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]

jobs:
install-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install yarn dependencies
run: |
yarn install
build-android:
needs: install-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install yarn dependencies
run: |
yarn install
- name: Build Android Release
run: |
cd client/android && ./gradlew assembleRelease
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: app-release.apk
path: android/app/build/outputs/apk/release/
28 changes: 28 additions & 0 deletions .github/workflows/docker.node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Image CI

on:
push:
branches:
- master
- dev
- andrew_testing
- release/*
pull_request:
branches:
- master
- dev
- andrew_testing

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker image
run: docker build -t packrat-app -f Dockerfile.prod .
42 changes: 42 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Add 'repo' label to any root file changes
repo:
- '*'

# Add 'test' label to any change to *.spec.ts and *.spec.js files within the entire repository
test:
- '**/*.spec.ts'
- '**/*.spec.js'

# Add 'frontend' label to any change in the 'client' directory
frontend:
- 'client/**/*.{ts,js}'
- any: ['client/**/*.ts', 'client/**/*.js']
all: ['!client/src/main.ts', '!client/src/main.js']

# Add 'backend' label to any change in the 'server' directory
backend:
- 'server/**/*.{ts,js}'

# Add the 'AnyChange' label to any changes within the entire repository
AnyChange:
- '**'
- '**/.*'
- '**/.*/**'
- '**/.*/**/.*'

# Workflow configuration starts here

name: Pull request labeler
on: [ pull_request_target ]

jobs:
triage:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

32 changes: 32 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This is a basic workflow that is manually triggered

name: Manual workflow

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
# Friendly description to be shown in the UI instead of 'name'
description: 'Person to greet'
# Default value if no value is explicitly provided
default: 'World'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
greet:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Send greeting
run: echo "Hello ${{ inputs.name }}"
93 changes: 93 additions & 0 deletions .github/workflows/node.js.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Node.js CI for Development Environment

on:
push:
branches: [ "**" ] # adjust this to the branches you want to run CI on
pull_request:
branches: [ "**" ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest] # Operating systems
node-version: [18.x, 20.x, 21.x] # Node.js versions

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Debug Information
run: |
yarn -v
ls .yarn/releases
cat .yarnrc.yml
cat yarn.lock
- name: ⚙️ Enable Corepack
run: |
corepack enable
echo "corepack enabled"
- name: Set Yarn Version to Berry
run: yarn set version berry

# run: yarn policies set-version

- name: Install dependencies
run: yarn install

- name: Debug more
run: |
yarn -v
yarn info packrat-world@workspace:.
yarn workspaces list --json
- name: Run setup
run: |
yarn -v
which yarn
yarn set version stable
yarn install
# cp client/.env.example client/.env
# cp client/app.json.example client/app.json
# cp server/.env.example server/.env

# yarn setup

# - name: Clean Cache and Reinstall
# run: |
# yarn cache clean
# yarn install --immutable

- name: Start Server in Background
run: |
cd server
yarn start &
- name: Start Expo in Background
run: |
cd apps/expo
yarn web &
- name: Wait for a while
run: sleep 120 # wait for some time to let the server start

- name: Kill Background Jobs (Unix)
if: matrix.os != 'windows-latest'
run: kill $(jobs -p) || true

- name: Kill Background Jobs (Windows)
if: matrix.os == 'windows-latest'
run: |
Get-Job | Stop-Job
Get-Job | Remove-Job
39 changes: 39 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest] # Operating systems
node-version: [18.x, 20.x, 21.x] # Node.js versions

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint code
run: yarn lint

- name: Run tests
continue-on-error: true
run: yarn test

- name: Build
run: yarn build:prod
8 changes: 6 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: preview
on: push
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]

jobs:
update:
name: EAS Update
name: EAS Android Preview Build
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down

0 comments on commit bb960cc

Please sign in to comment.