Skip to content

Commit

Permalink
Merge branch 'main' into expo-build-for-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
whusterj authored Nov 12, 2024
2 parents 0c5da30 + 26e6860 commit adc448e
Show file tree
Hide file tree
Showing 168 changed files with 3,067 additions and 1,700 deletions.
161 changes: 0 additions & 161 deletions .github/workflows/cypress.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: E2E Tests
on: [deployment_status]

jobs:
Setup:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Can't use cache because of https://github.com/actions/cache/issues/319
# cache: 'pipenv'
- name: Install bootstrapper dependencies
run: pipenv install --dev --deploy
- run: |
config_file=$(./scripts/vue_or_react.sh)
pipenv run cookiecutter . --config-file $config_file --no-input -f
cat $config_file
- uses: actions/upload-artifact@v4
with:
name: my_project
path: my_project/
retention-days: 1
Playwright:
needs: Setup
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: my_project
path: my_project/
- uses: actions/setup-node@v4
with:
node-version: 18
- name: 📦 Install frontend dependencies
working-directory: ./my_project/client
run: npm install
- name: 🎭 Install Playwright
working-directory: ./my_project/client
run: npx playwright install --with-deps
- name: Run Playwright tests against ${{ github.event.deployment_status.environment_url }}
working-directory: ./my_project/client
run: npx playwright test --reporter=html
env:
NPM_CONFIG_PRODUCTION: false
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.environment_url }}
PLAYWRIGHT_TEST_USER_PASS: ${{ secrets.PLAYWRIGHT_TEST_USER_PASS }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: my_project/client/playwright-report/
retention-days: 30
12 changes: 6 additions & 6 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- run: pipenv install --dev --deploy
- name: Run Black
Expand All @@ -21,7 +21,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- run: pipenv install --dev --deploy
- name: Run flake8
Expand All @@ -36,7 +36,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand All @@ -58,7 +58,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand All @@ -80,7 +80,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pipenv"
- name: 🐍 Install python dependencies
run: pipenv install --dev --deploy
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Mobile Deployment
on: [deployment_status, workflow_dispatch]

jobs:
Setup:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install pipenv
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Can't use cache because of https://github.com/actions/cache/issues/319
# cache: 'pipenv'
- name: Install bootstrapper dependencies
run: pipenv install --dev --deploy
- run: |
config_file=$(./scripts/vue_or_react.sh)
pipenv run cookiecutter . --config-file $config_file --no-input -f
cat $config_file
- uses: actions/upload-artifact@v4
with:
name: my_project
path: my_project/
retention-days: 1
configuremobile:
needs: Setup
runs-on: ubuntu-latest
outputs:
BUILD_MOBILE_APP: ${{ steps.checkdiff.outputs.BUILD_MOBILE_APP }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 5
name: check diff
- id: checkdiff
run: |
git fetch origin main
if [ {{ "${{ github.event_name }}" }} == "workflow_dispatch" ]; then
echo "This workflow was triggered by a workflow_dispatch event."
echo "BUILD_MOBILE_APP=1" >> $GITHUB_OUTPUT
else
echo $(git diff --name-only origin/main -- | grep "/clients/mobile/react-native/" | wc -l)
echo "BUILD_MOBILE_APP=$(git diff --name-only origin/main -- | grep "/clients/mobile/react-native/" | wc -l)" >> $GITHUB_OUTPUT
fi
publish:
if: needs.configuremobile.outputs.BUILD_MOBILE_APP != 0
needs: configuremobile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: my_project
path: my_project/
- name: Create config files
run: |
cp resources/app.config.vars.txt my_project/resources/app.config.vars.txt
cp resources/eas.vars.txt my_project/resources/eas.vars.txt
cd my_project
current_dir=$(pwd)
. scripts/setup_mobile_config.sh "$current_dir/mobile/app.config.js" "$current_dir/resources/app.config.vars.txt"
. scripts/setup_mobile_config.sh "$current_dir/mobile/eas.json" "$current_dir/resources/eas.vars.txt"
# - uses: actions/cache@v4
# with:
# path: "**/node_modules"
# key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: 🏗 Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
# cache: npm
# cache-dependency-path: ./mobile/package-lock.json

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: 📦 Install dependencies
working-directory: ./my_project/mobile
run: npm install

- name: 🚀 Publish preview
working-directory: ./my_project/mobile
run: |
eas update --branch="${{ github.event.deployment_status.environment_url }}" --non-interactive --auto
echo "${{ env.BACKEND_SERVER_URL }} and ${{ github.event.deployment_status.environment_url }}"
env:
EXPO_PUBLIC_BACKEND_SERVER_URL: "${{ github.event.deployment_status.environment_url }}"
EXPO_PUBLIC_ROLLBAR_ACCESS_TOKEN: "1a19e5da05b2435b802d5a81aba2bbd7"
Loading

0 comments on commit adc448e

Please sign in to comment.