Skip to content
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
249 changes: 125 additions & 124 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,128 +60,129 @@ jobs:

- uses: actions/upload-artifact@master
with:
name: web-build
path: web-build/

cypress-percy:
name: cypress-percy
needs:
- build-web
runs-on: ubuntu-latest
# Run only on main branch
if: github.event_name != 'pull_request' && ( github.ref_protected == true )
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- uses: actions/download-artifact@master
with:
name: web-build
path: web-build/

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build docker image for cypress tests
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: ${{ env.IMAGE_NAME }}:cypresstest
labels: ${{ steps.meta.outputs.labels }}

- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: docker run --rm -p 80:80 ${{ env.IMAGE_NAME }}:cypresstest
command-prefix: percy exec -- npx
config: baseUrl=http://localhost:80
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

cypress:
name: cypress
needs:
- build-web
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- uses: actions/download-artifact@master
with:
name: web-build
path: web-build/

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build docker image for cypress tests
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: ${{ env.IMAGE_NAME }}:cypresstest
labels: ${{ steps.meta.outputs.labels }}

- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: docker run --rm -p 80:80 ${{ env.IMAGE_NAME }}:cypresstest
config: baseUrl=http://localhost:80

- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots
path: cypress/screenshots/**/*
retention-days: 5
name: dist
path: dist/

# cypress-percy:
# name: cypress-percy
# needs:
# - build-web
# runs-on: ubuntu-latest
# # Run only on main branch
# if: github.event_name != 'pull_request' && ( github.ref_protected == true )
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: cache node modules
# uses: actions/cache@v4
# env:
# cache-name: cache-node-modules
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

# - uses: actions/download-artifact@master
# with:
# name: dist
# path: dist/

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Extract Docker metadata
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# - name: Build docker image for cypress tests
# uses: docker/build-push-action@v5
# with:
# context: .
# push: false
# load: true
# tags: ${{ env.IMAGE_NAME }}:cypresstest
# labels: ${{ steps.meta.outputs.labels }}

# - name: Cypress run
# uses: cypress-io/github-action@v6
# with:
# start: docker run --rm -p 80:80 ${{ env.IMAGE_NAME }}:cypresstest
# command-prefix: percy exec -- npx
# config: baseUrl=http://localhost:80
# env:
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

# cypress:
# name: cypress
# needs:
# - build-web
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: cache node modules
# uses: actions/cache@v4
# env:
# cache-name: cache-node-modules
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

# - uses: actions/download-artifact@master
# with:
# name: dist
# path: dist/

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Extract Docker metadata
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# - name: Build docker image for cypress tests
# uses: docker/build-push-action@v5
# with:
# context: .
# push: false
# load: true
# tags: ${{ env.IMAGE_NAME }}:cypresstest
# labels: ${{ steps.meta.outputs.labels }}

# - name: Cypress run
# uses: cypress-io/github-action@v6
# with:
# start: docker run --rm -p 80:80 ${{ env.IMAGE_NAME }}:cypresstest
# config: baseUrl=http://localhost:80

# - name: "Upload Artifact"
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: cypress-screenshots
# path: cypress/screenshots/**/*
# retention-days: 5

sonarcloud:
name: SonarCloud
Expand Down Expand Up @@ -237,8 +238,8 @@ jobs:

- uses: actions/download-artifact@master
with:
name: web-build
path: web-build/
name: dist
path: dist/

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:

- uses: actions/upload-artifact@master
with:
name: web-build
path: web-build/
name: dist
path: dist/

docker:
name: BuildDocker
Expand All @@ -61,8 +61,8 @@ jobs:

- uses: actions/download-artifact@master
with:
name: web-build
path: web-build/
name: dist
path: dist/

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build-web:
- npm run build-web
artifacts:
paths:
- web-build/
- dist/

sonarqube:
stage: test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
ENV DEBUG_MODE=false
COPY nginx/nginx.conf /etc/nginx/templates/nginx.conf.conf

COPY /web-build /usr/share/nginx/html
COPY /dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
10 changes: 7 additions & 3 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#docker build -f Dockerfile.builder . -t easbuilder
#docker run -it -e EXPO_TOKEN= -v "$(pwd)":/builder easbuilder <eas profile for building>

FROM ubuntu:latest
FROM ubuntu:22.04

RUN echo '\
Acquire::Retries "100";\
Expand Down Expand Up @@ -30,13 +30,17 @@ COPY scripts/build-android.sh /usr/local/bin/build-android
RUN git config --global --add safe.directory /builder

ENV ANDROID_HOME /usr/lib/android-sdk
RUN sdkmanager --install "build-tools;23.0.0" "ndk-bundle;r23" "ndk;23.1.7779620" "ndk;25.1.8937393" "platforms;android-23" "tools;23.0.5"
RUN yes | sdkmanager --licenses
RUN sdkmanager --install "build-tools;29.0.3" "ndk-bundle;r26" "ndk;26.1.10909125" "platforms;android-35" "tools;26.1.1"
# RUN yes | sdkmanager --licenses


RUN mkdir /builder
WORKDIR /builder

# EAS clones the repository internally, this fails if the repository is not considered as safe
RUN git config --global --add safe.directory /builder/.git

ENV EXPO_TOKEN ""

ENTRYPOINT ["/usr/local/bin/build-android"]

4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "CookPal",
"slug": "opencookbook",
"scheme": "cookpal",
"version": "1.5.3",
"version": "1.6.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"androidStatusBar": {
Expand Down Expand Up @@ -60,7 +60,7 @@
"WRITE_EXTERNAL_STORAGE",
"ACCESS_NETWORK_STATE"
],
"versionCode": 30
"versionCode": 32
},
"web": {
"favicon": "./assets/icon.png"
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
'baseUrl': 'http://localhost:19006',
'baseUrl': 'http://localhost:8081',
setupNodeEvents(on, config) {
// implement node event listeners here
},
Expand Down
14 changes: 1 addition & 13 deletions cypress/e2e/percy/navigate-login-screen.cy.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
// / <reference types="cypress" />
// Welcome to Cypress!
//
// This spec file contains a variety of sample tests
// for a todo list app that are designed to demonstrate
// the power of writing tests in Cypress.
//
// To learn more about how Cypress works and
// what makes it such an awesome testing tool,
// please read our getting started guide:
// https://on.cypress.io/introduction-to-cypress

describe('Login form', () => {
beforeEach(() => {
cy.visit('/');
});

it('login page shown', () => {
cy.location('pathname').should('equal', '/LoginScreen');
cy.location('pathname').should('equal', '/');
cy.percySnapshot();
});

it('password reset form', () => {
cy.visit('/LoginScreen');
cy.get('[data-testid="forgotPassword"]').click();
cy.get('[data-testid="password-reset-title"]').should('exist');
cy.percySnapshot();
});

it('register form', () => {
cy.visit('/LoginScreen');
cy.get('[data-testid="SignUpButton"]').click();
cy.get('[data-testid="signup-title"]').should('exist');
cy.percySnapshot();
Expand Down
Loading
Loading