Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Switch to new backend, remove graphql #903

Merged
merged 5 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 54 additions & 54 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
name: pr

on:
push:
branches:
- master
pull_request:
branches:
- master
- 'production-v*.*'
push:
branches:
- master
pull_request:
branches:
- master
- 'production-v*.*'

env:
SIS_HAWK_KEY: ${{ secrets.SIS_STAGING_HAWK_KEY }}
SIS_SENTRY_ORG: ${{ secrets.SIS_STAGING_SENTRY_ORG }}
SIS_SENTRY_PROJECT: ${{ secrets.SIS_STAGING_SENTRY_PROJECT }}
SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_STAGING_SENTRY_AUTH_TOKEN }}
SIS_HAWK_KEY: ${{ secrets.SIS_STAGING_HAWK_KEY }}
SIS_SENTRY_ORG: ${{ secrets.SIS_STAGING_SENTRY_ORG }}
SIS_SENTRY_PROJECT: ${{ secrets.SIS_STAGING_SENTRY_PROJECT }}
SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_STAGING_SENTRY_AUTH_TOKEN }}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn install
- run: yarn lint
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn install
- run: yarn test:unit
test-e2e:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: expo/expo-github-action@v5
with:
expo-version: 3.x
expo-cache: true
- name: Install applesimutils
run: |
brew tap wix/brew
brew install applesimutils
- run: yarn install
- name: Generate staging app.json
run: ./scripts/generateAppJson.js > app.json
- name: Download ExpoClient binary
run: ./e2e/dl_expo_bins.sh
- name: Run E2E Tests
run: |
# Start packager in background
yarn start >/dev/null &
PID=$(ps $! | tail -1 | awk '{print $1}')
# Run e2e test
yarn test:e2e
# Kill packager
kill $PID
- uses: actions/upload-artifact@master
if: always()
with:
name: test-e2e-artifacts
path: ./artifacts
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn install
- run: yarn lint
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn install
- run: yarn test:unit
test-e2e:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: expo/expo-github-action@v5
with:
expo-version: 3.x
expo-cache: true
- name: Install applesimutils
run: |
brew tap wix/brew
brew install applesimutils
- run: yarn install
- name: Generate staging app.json
run: ./scripts/generateAppJson.js > app.json
- name: Download ExpoClient binary
run: ./e2e/dl_expo_bins.sh
- name: Run E2E Tests
run: |
# Start packager in background
yarn start >/dev/null &
PID=$(ps $! | tail -1 | awk '{print $1}')
# Run e2e test
yarn test:e2e
# Kill packager
kill $PID
- uses: actions/upload-artifact@master
if: always()
with:
name: test-e2e-artifacts
path: ./artifacts
112 changes: 56 additions & 56 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
name: production

on:
push:
branches:
- 'production-v*.*'
tags:
- 'v*.*.*'
push:
branches:
- 'production-v*.*'
tags:
- 'v*.*.*'

env:
SIS_AQICN_TOKEN: ${{ secrets.SIS_PRODUCTION_AQICN_TOKEN }}
SIS_AMPLITUDE_API_KEY: ${{ secrets.SIS_PRODUCTION_AMPLITUDE_API_KEY }}
SIS_BACKEND_URL: https://shootismoke.now.sh/api/graphql
SIS_HAWK_KEY: ${{ secrets.SIS_PRODUCTION_HAWK_KEY }}
SIS_SENTRY_PUBLIC_DNS: ${{ secrets.SIS_PRODUCTION_SENTRY_PUBLIC_DNS }}
SIS_SENTRY_ORG: ${{ secrets.SIS_PRODUCTION_SENTRY_ORG }}
SIS_SENTRY_PROJECT: ${{ secrets.SIS_PRODUCTION_SENTRY_PROJECT }}
SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_PRODUCTION_SENTRY_AUTH_TOKEN }}
SIS_GOOGLE_SERVICES_JSON: ${{ secrets.SIS_PRODUCTION_GOOGLE_SERVICES_JSON }}
SIS_ANDROID_GOOGLE_MAPS_KEY: ${{ secrets.SIS_PRODUCTION_ANDROID_GOOGLE_MAPS_KEY }}
SIS_IOS_GOOGLE_MAPS_KEY: ${{ secrets.SIS_PRODUCTION_IOS_GOOGLE_MAPS_KEY }}
SIS_AQICN_TOKEN: ${{ secrets.SIS_PRODUCTION_AQICN_TOKEN }}
SIS_AMPLITUDE_API_KEY: ${{ secrets.SIS_PRODUCTION_AMPLITUDE_API_KEY }}
SIS_BACKEND_URL: https://shootismoke.app
SIS_HAWK_KEY: ${{ secrets.SIS_PRODUCTION_HAWK_KEY }}
SIS_SENTRY_PUBLIC_DNS: ${{ secrets.SIS_PRODUCTION_SENTRY_PUBLIC_DNS }}
SIS_SENTRY_ORG: ${{ secrets.SIS_PRODUCTION_SENTRY_ORG }}
SIS_SENTRY_PROJECT: ${{ secrets.SIS_PRODUCTION_SENTRY_PROJECT }}
SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_PRODUCTION_SENTRY_AUTH_TOKEN }}
SIS_GOOGLE_SERVICES_JSON: ${{ secrets.SIS_PRODUCTION_GOOGLE_SERVICES_JSON }}
SIS_ANDROID_GOOGLE_MAPS_KEY: ${{ secrets.SIS_PRODUCTION_ANDROID_GOOGLE_MAPS_KEY }}
SIS_IOS_GOOGLE_MAPS_KEY: ${{ secrets.SIS_PRODUCTION_IOS_GOOGLE_MAPS_KEY }}

jobs:
# Build native binaries on production release channel
expo-production:
runs-on: ubuntu-latest
strategy:
matrix:
build: [android-apk, android-app-bundle, ios]
include:
# Include, for each build, the expo build command
- build: android-apk
expo_build_command: build:android -t apk
- build: android-app-bundle
expo_build_command: build:android -t app-bundle
- build: ios
expo_build_command: build:ios
# expo-cli can only run one build at a time
# https://github.com/expo/expo-cli/issues/1820
max-parallel: 1
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: expo/expo-github-action@v5
with:
expo-version: 3.x
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
expo-cache: true
- run: yarn install
- name: Set RELEASE_CHANNEL env variable # Will be v*.* (major.minor)
if: startsWith(github.ref, 'refs/heads/production-v')
run: echo ::set-env name=RELEASE_CHANNEL::${GITHUB_REF:22} # Remove refs/heads/production-
- name: Set RELEASE_CHANNEL env variable # Will be v*.*.* (major.minor.patch)
if: startsWith(github.ref, 'refs/tags/v')
run: echo ::set-env name=RELEASE_CHANNEL::${GITHUB_REF:10} # Remove refs/tags/
- name: Generate production app.json
run: |
./scripts/generateAppJson.js > app.json
./scripts/generateGoogleServicesJson.js > google-services.json
- run: expo ${{ matrix.expo_build_command }} --release-channel=production-${{ env.RELEASE_CHANNEL }}
# Build native binaries on production release channel
expo-production:
runs-on: ubuntu-latest
strategy:
matrix:
build: [android-apk, android-app-bundle, ios]
include:
# Include, for each build, the expo build command
- build: android-apk
expo_build_command: build:android -t apk
- build: android-app-bundle
expo_build_command: build:android -t app-bundle
- build: ios
expo_build_command: build:ios
# expo-cli can only run one build at a time
# https://github.com/expo/expo-cli/issues/1820
max-parallel: 1
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: expo/expo-github-action@v5
with:
expo-version: 3.x
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
expo-cache: true
- run: yarn install
- name: Set RELEASE_CHANNEL env variable # Will be v*.* (major.minor)
if: startsWith(github.ref, 'refs/heads/production-v')
run: echo ::set-env name=RELEASE_CHANNEL::${GITHUB_REF:22} # Remove refs/heads/production-
- name: Set RELEASE_CHANNEL env variable # Will be v*.*.* (major.minor.patch)
if: startsWith(github.ref, 'refs/tags/v')
run: echo ::set-env name=RELEASE_CHANNEL::${GITHUB_REF:10} # Remove refs/tags/
- name: Generate production app.json
run: |
./scripts/generateAppJson.js > app.json
./scripts/generateGoogleServicesJson.js > google-services.json
- run: expo ${{ matrix.expo_build_command }} --release-channel=production-${{ env.RELEASE_CHANNEL }}
48 changes: 24 additions & 24 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: master

on:
push:
branches:
- master
push:
branches:
- master

env:
SIS_HAWK_KEY: ${{ secrets.SIS_STAGING_HAWK_KEY }}
SIS_SENTRY_ORG: ${{ secrets.SIS_STAGING_SENTRY_ORG }}
SIS_SENTRY_PROJECT: ${{ secrets.SIS_STAGING_SENTRY_PROJECT }}
SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_STAGING_SENTRY_AUTH_TOKEN }}
SIS_HAWK_KEY: ${{ secrets.SIS_STAGING_HAWK_KEY }}
SIS_SENTRY_ORG: ${{ secrets.SIS_STAGING_SENTRY_ORG }}
SIS_SENTRY_PROJECT: ${{ secrets.SIS_STAGING_SENTRY_PROJECT }}
SIS_SENTRY_AUTH_TOKEN: ${{ secrets.SIS_STAGING_SENTRY_AUTH_TOKEN }}

jobs:
expo-staging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: expo/expo-github-action@v5
with:
expo-version: 3.x
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
expo-cache: true
- run: yarn install
- name: Generate staging app.json
run: ./scripts/generateAppJson.js > app.json
- run: expo publish
expo-staging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: expo/expo-github-action@v5
with:
expo-version: 3.x
expo-username: ${{ secrets.EXPO_CLI_USERNAME }}
expo-password: ${{ secrets.EXPO_CLI_PASSWORD }}
expo-cache: true
- run: yarn install
- name: Generate staging app.json
run: ./scripts/generateAppJson.js > app.json
- run: expo publish
17 changes: 1 addition & 16 deletions App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Sh**t! I Smoke. If not, see <http://www.gnu.org/licenses/>.

import { ApolloClient, ApolloProvider } from '@apollo/client';
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
import Constants from 'expo-constants';
import * as Font from 'expo-font';
Expand All @@ -29,9 +28,7 @@ import {
ApiContextProvider,
DistanceUnitProvider,
ErrorContextProvider,
getApolloClient,
LocationContextProvider,
TCacheShape,
} from './stores';
import { setupAmplitude, track } from './util/amplitude';
import { IS_SENTRY_SET_UP, RELEASE_CHANNEL } from './util/constants';
Expand All @@ -52,7 +49,6 @@ if (IS_SENTRY_SET_UP) {

export function App(): React.ReactElement {
const [ready, setReady] = useState(false);
const [client, setClient] = useState<ApolloClient<TCacheShape>>();

useEffect(() => {
Promise.all([
Expand All @@ -69,11 +65,6 @@ export function App(): React.ReactElement {
.catch(sentryError('App'));
}, []);

useEffect(() => {
// Load the Offix client
getApolloClient().then(setClient).catch(sentryError('App'));
}, []);

useEffect(() => {
// Track user closing/re-opening the app
AppState.addEventListener('change', (state) => {
Expand All @@ -92,13 +83,7 @@ export function App(): React.ReactElement {
<ApiContextProvider>
<FrequencyContextProvider>
<DistanceUnitProvider>
{ready && client ? (
<ApolloProvider client={client}>
<Screens />
</ApolloProvider>
) : (
<LoadingBackground />
)}
{ready ? <Screens /> : <LoadingBackground />}
</DistanceUnitProvider>
</FrequencyContextProvider>
</ApiContextProvider>
Expand Down
Loading