Skip to content

Commit

Permalink
feat: add build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
razinj committed Jun 23, 2024
1 parent 1e88eb2 commit 6cbedf2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

on: [push]

jobs:
gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: "18.x"

- name: Install Node.js Dependencies
run: npm ci

- name: Use Java 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "microsoft"

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Set Android SDK Directory
run: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > $GITHUB_WORKSPACE/android/local.properties
- name: Decode and save the keystore file
run: |
echo ${{ secrets.CONTEXT_LAUNCHER_UPLOAD_STORE_FILE }} | base64 --decode > $GITHUB_WORKSPACE/android/upload.keystore
- name: Set environment variables
run: |
echo "CONTEXT_LAUNCHER_UPLOAD_STORE_PASSWORD=${{ secrets.CONTEXT_LAUNCHER_UPLOAD_STORE_PASSWORD }}" >> $GITHUB_ENV
echo "CONTEXT_LAUNCHER_UPLOAD_KEY_ALIAS=${{ secrets.CONTEXT_LAUNCHER_UPLOAD_KEY_ALIAS }}" >> $GITHUB_ENV
echo "CONTEXT_LAUNCHER_UPLOAD_KEY_PASSWORD=${{ secrets.CONTEXT_LAUNCHER_UPLOAD_KEY_PASSWORD }}" >> $GITHUB_ENV
echo "CONTEXT_LAUNCHER_UPLOAD_STORE_FILE=$GITHUB_WORKSPACE/android/upload.keystore" >> $GITHUB_ENV
- name: Build
working-directory: ./android
run: ./gradlew --no-daemon build
8 changes: 6 additions & 2 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: "20.x"

- name: Install Dependencies
run: npm ci
- name: Check Formatting
run: npm run format:ci

# TODO: Add linting check
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ jobs:
jest-tests:
strategy:
matrix:
node-version: ['18.x', '20.x']
node-version: ["18.x", "20.x"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4

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

- name: Install Dependencies
run: npm ci

- name: Run Tests
run: npm run test:ci

0 comments on commit 6cbedf2

Please sign in to comment.