diff --git a/.github/workflows/budgets.json b/.github/workflows/budgets.json new file mode 100644 index 0000000..dd634d3 --- /dev/null +++ b/.github/workflows/budgets.json @@ -0,0 +1,16 @@ +[ + { + "path": "/*", + "resourceSizes": [ + { + "resourceType": "document", + "budget": 18 + }, + { + "resourceType": "total", + "budget": 200 + } + ] + } +] + diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml new file mode 100644 index 0000000..cd7ced2 --- /dev/null +++ b/.github/workflows/cypress.yml @@ -0,0 +1,14 @@ +name: (Cypress) Visual + +on: push + +jobs: + cypress-run: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - uses: isbang/compose-action@v1.0.0 + with: + compose-file: './docker-compose-cypress.yml' + down-flags: '--volumes' diff --git a/.github/workflows/gh-page.yaml b/.github/workflows/gh-page.yaml new file mode 100644 index 0000000..71e61dc --- /dev/null +++ b/.github/workflows/gh-page.yaml @@ -0,0 +1,38 @@ +name: Build and Deploy +on: + push: + branches: + - master +jobs: + build-and-deploy: + concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: | + **/node_modules + **/.eslintcache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install packages + run: yarn install --frozen-lockfile + + - name: Build + run: PUBLIC_URL="/caelum/" yarn build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.2.3 + with: + branch: gh-pages # The branch the action should deploy to. + folder: build # The folder the action should deploy. diff --git a/.github/workflows/heroku-deploy.yml b/.github/workflows/heroku-deploy.yml deleted file mode 100644 index a5123c7..0000000 --- a/.github/workflows/heroku-deploy.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Deploy to heroku - -on: - push: - branches: - - master - -jobs: - build_heroku: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: yarn - - run: yarn build - - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action - with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} - heroku_app_name: "caelum-weather" # Must be unique in Heroku - heroku_email: "maildopdf@gmail.com" - branch: master diff --git a/.github/workflows/lighthouse-ghpage.yml b/.github/workflows/lighthouse-ghpage.yml new file mode 100644 index 0000000..4dcff4e --- /dev/null +++ b/.github/workflows/lighthouse-ghpage.yml @@ -0,0 +1,18 @@ +name: Lighthouse CI +on: + push: + branches: + - master +jobs: + lighthouse: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Audit URLs using Lighthouse + uses: treosh/lighthouse-ci-action@v9 + with: + urls: | + https://duelsik.github.io/caelum/ + budgetPath: ./budget.json # test performance budgets + uploadArtifacts: true # save results as an action artifacts + temporaryPublicStorage: true # upload lighthouse report to the temporary storage diff --git a/Dockerfile b/Dockerfile index 03e83dd..7981584 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,4 @@ COPY .prettierrc.json . COPY tsconfig.json . -COPY .env . - # No cmd, it is just a def for docker-compose diff --git a/cypress/snapshots/mobileApp.spec.ts/Mobile app -- location modal should match image snapshot.snap.png b/cypress/snapshots/mobileApp.spec.ts/Mobile app -- location modal should match image snapshot.snap.png index 36361e6..e6cec03 100644 Binary files a/cypress/snapshots/mobileApp.spec.ts/Mobile app -- location modal should match image snapshot.snap.png and b/cypress/snapshots/mobileApp.spec.ts/Mobile app -- location modal should match image snapshot.snap.png differ diff --git a/cypress/videos/mobileApp.spec.ts.mp4 b/cypress/videos/mobileApp.spec.ts.mp4 new file mode 100644 index 0000000..bccf8d6 Binary files /dev/null and b/cypress/videos/mobileApp.spec.ts.mp4 differ diff --git a/package.json b/package.json index c38ce47..1669818 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "eject": "react-scripts eject", "cypress:open": "cypress open", "storybook": "start-storybook -p 6006 -s public", - "build-storybook": "build-storybook -s public" + "build-storybook": "build-storybook -s public", + "test:visual": "cypress run" }, "browserslist": { "production": [