-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into expo-build-for-pr
- Loading branch information
Showing
168 changed files
with
3,067 additions
and
1,700 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |
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
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
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" |
Oops, something went wrong.