Skip to content

Commit

Permalink
Introduce Actions workflow to test without building (#20)
Browse files Browse the repository at this point in the history
This should prevent the class of issue that happened after #16 was merged, which broke the Action externally.
  • Loading branch information
kevin-david authored Aug 6, 2024
1 parent c6e3645 commit 65127d3
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 74 deletions.
40 changes: 40 additions & 0 deletions .github/shared/functional-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Functional tests"
description: "Run functional tests against the app in lib/index.js"

runs:
using: "composite"
steps:
- name: Load test key
shell: bash
id: get_key
run: |
value=$(cat src/tests/test_key_b64.txt)
echo "text=$value" >> $GITHUB_OUTPUT
- uses: ./
name: zipalign and Sign APK
with:
releaseDirectory: src/tests/apk-zip
signingKeyBase64: ${{ steps.get_key.outputs.text }}
alias: test_key
keyStorePassword: android
keyPassword: android
zipAlign: true

- uses: ./
name: Sign APK
with:
releaseDirectory: src/tests/apk
signingKeyBase64: ${{ steps.get_key.outputs.text }}
alias: test_key
keyStorePassword: android
keyPassword: android

- uses: ./
name: Sign AAB
with:
releaseDirectory: src/tests/aab
signingKeyBase64: ${{ steps.get_key.outputs.text }}
alias: test_key
keyStorePassword: android
keyPassword: android
42 changes: 42 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Build and test"

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
name: Build and test

steps:
- uses: actions/checkout@v4
name: Checkout

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: eslint
run: npx eslint

- name: Ensure no pending Git changes
run: |
GIT_STATUS=$(git status --porcelain)
if [[ -n $GIT_STATUS ]]; then
echo "There are pending Git changes after running the build. Did you forget to commit the .js files?"
echo "$GIT_STATUS"
exit 1
fi
- name: Run unit tests
run: npm run test

- uses: "./.github/shared/functional-tests"
74 changes: 0 additions & 74 deletions .github/workflows/release.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/test-no-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Test compiled action"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
name: Test action

steps:
- uses: actions/checkout@v4
name: Checkout

- uses: "./.github/shared/functional-tests"

0 comments on commit 65127d3

Please sign in to comment.