Skip to content

Commit

Permalink
feat: second commit with remaining apathy app data
Browse files Browse the repository at this point in the history
  • Loading branch information
ymijsters committed Nov 5, 2024
1 parent aea059c commit d194820
Show file tree
Hide file tree
Showing 84 changed files with 46,817 additions and 1,608 deletions.
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
}
],
"import/prefer-default-export": "off",
"prettier/prettier": "error",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"import/extensions": [
"error",
"ignorePackages",
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/auto-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Auto Tag

on:
issues:
types:
- reopened
- closed
pull_request:
types:
- closed

jobs:
auto-tag:
name: Auto tag issues and PRs
uses: graasp/graasp-deploy/.github/workflows/auto-tag.yml@v1
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Check

on:
push:
branches:
- main
merge_group:
pull_request:

jobs:
build:
concurrency: build-${{ github.head_ref || github.ref }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1

- name: Lint
run: yarn check

- name: Build
run: yarn build
73 changes: 73 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Cypress UI tests

on:
push:
branches:
- main
merge_group:
pull_request:

jobs:
cypress-run:
concurrency: cypress-${{ github.head_ref || github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1
with:
cypress: true

- name: Build App
run: yarn build:test
shell: bash
env:
VITE_PORT: 3000
VITE_API_HOST: http://localhost:3636
VITE_GRAASP_APP_KEY: id-1234567890
VITE_ENABLE_MOCK_API: true
VITE_VERSION: cypress-tests

- name: Cypress Run
uses: cypress-io/github-action@v5
env:
VITE_PORT: 3000
VITE_API_HOST: http://localhost:3636
VITE_GRAASP_APP_KEY: id-1234567890
VITE_ENABLE_MOCK_API: true
VITE_VERSION: cypress-tests
with:
install: false
config: baseUrl=http://localhost:3000
start: yarn preview:test
browser: chrome
quiet: true
# point to new cypress@10 config file
config-file: cypress.config.ts

- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots

- name: coverage report
run: npx nyc report --reporter=text-summary

- name: coverage commit status
run: |
total=$(cat coverage/coverage-summary.json | jq .total.lines.pct)
echo Total coverage ${total}
curl -S -s \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/${REPO_PATH}/statuses/${COMMIT_SHA} \
-d "{\"state\":\"success\",\"target_url\":\"https://github.com/${REPO_PATH}/actions/runs/${RUN_ID}\",\"description\":\"${total}%\",\"context\":\"code-coverage\"}"
env:
GITHUB_TOKEN: ${{ github.token }}
REPO_PATH: ${{ github.repository }}
COMMIT_SHA: ${{ github.sha }}
RUN_ID: ${{ github.run_id }}
48 changes: 48 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to development environment

# Controls when the action will run
on:
# Triggers the workflow on push events only for the main branch
push:
branches:
- main

# Allows to run the workflow manually from the Actions tab
workflow_dispatch:

jobs:
deploy-app:
name: Deploy to dev
runs-on: ubuntu-latest
environment: development
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Yarn install and Cache dependencies
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1

- name: Yarn build
# Set environment variables required to perform the build. These are only available to this step
env:
VITE_API_HOST: ${{ vars.VITE_API_HOST }}
VITE_GRAASP_APP_KEY: ${{ secrets.APP_KEY }}
VITE_SENTRY_ENV: development
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_VERSION: ${{ github.sha }}
# add any env variable needed by your app here
run: yarn build
shell: bash

- name: Deploy
uses: graasp/graasp-deploy/.github/actions/deploy-s3-app@v1
with:
# Replace input build-folder or version if needed
build-folder: 'build'
graasp-app-id: ${{ secrets.APP_ID }}
version: 'latest'
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_DEV }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
aws-region: ${{ vars.APPS_AWS_REGION_DEV }}
aws-s3-bucket-name: ${{ vars.AWS_S3_BUCKET_NAME_APPS_DEV }}
cloudfront-distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_APPS_DEV }}
52 changes: 52 additions & 0 deletions .github/workflows/deploy-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy to GitHub Pages

# Controls when the action will run
on:
# Triggers the workflow on repository-dispatch event
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Yarn install and Cache dependencies
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1

- name: Yarn build
# Set environment variables required to perform the build. These are only available to this step
env:
VITE_API_HOST: ${{ vars.VITE_API_HOST }}
VITE_GRAASP_APP_KEY: ${{ secrets.APP_KEY }}
VITE_SENTRY_ENV: production
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_VERSION: github-${{ github.sha }}
# add any env variable needed by your app here
run: yarn build
shell: bash

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
46 changes: 46 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to production environment

# Controls when the action will run
on:
# Triggers the workflow on repository-dispatch event
repository_dispatch:
types: [production-deployment]

jobs:
deploy-app:
name: Deploy to production
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.tag }}

- name: Yarn install and Cache dependencies
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1

- name: Yarn build
# Set environment variables required to perform the build. These are only available to this step
env:
VITE_API_HOST: ${{ vars.VITE_API_HOST }}
VITE_GRAASP_APP_KEY: ${{ secrets.APP_KEY }}
VITE_SENTRY_ENV: production
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_VERSION: ${{ github.event.client_payload.tag }}
# add any env variable needed by your app here
run: yarn build
shell: bash

- name: Deploy
uses: graasp/graasp-deploy/.github/actions/deploy-s3-app@v1
with:
# Replace input build-folder or version if needed
build-folder: 'build'
graasp-app-id: ${{ secrets.APP_ID }}
version: 'latest'
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_PROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PROD }}
aws-region: ${{ vars.APPS_AWS_REGION_PROD }}
aws-s3-bucket-name: ${{ vars.AWS_S3_BUCKET_NAME_APPS_PROD }}
cloudfront-distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_APPS_PROD }}
46 changes: 46 additions & 0 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to staging environment

# Controls when the action will run
on:
# Triggers the workflow on repository-dispatch event
repository_dispatch:
types: [staging-deployment]

jobs:
deploy-app:
name: Deploy to staging
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.tag }}

- name: Yarn install and Cache dependencies
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1

- name: Yarn build
# Set environment variables required to perform the build. These are only available to this step
env:
VITE_API_HOST: ${{ vars.VITE_API_HOST }}
VITE_GRAASP_APP_KEY: ${{ secrets.APP_KEY }}
VITE_SENTRY_ENV: staging
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VITE_VERSION: ${{ github.event.client_payload.tag }}
# add any env variable needed by your app here
run: yarn build
shell: bash

- name: Deploy
uses: graasp/graasp-deploy/.github/actions/deploy-s3-app@v1
with:
# Replace input build-folder or version if needed
build-folder: 'build'
graasp-app-id: ${{ secrets.APP_ID }}
version: 'latest'
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_STAGE }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGE }}
aws-region: ${{ vars.APPS_AWS_REGION_STAGE }}
aws-s3-bucket-name: ${{ vars.AWS_S3_BUCKET_NAME_APPS_STAGE }}
cloudfront-distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_APPS_STAGE }}
42 changes: 42 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release-please

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node

- uses: actions/checkout@v4

- name: Set tag
if: ${{ steps.release.outputs.releases_created == 'true' }}
id: set-tag
run: |
REPOSITORY=$(echo '${{ github.repository }}')
TAG=$(echo '${{ steps.release.outputs.tag_name }}')
JSON=$(jq -c --null-input --arg repository "$REPOSITORY" --arg tag "$TAG" '{"repository": $repository, "tag": $tag}')
echo "json=$JSON" >> $GITHUB_OUTPUT
# Trigger an 'on: repository_dispatch' workflow to run in graasp-deploy repository
- name: Push tag to Graasp Deploy (Staging)
if: ${{ steps.release.outputs.releases_created == 'true' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: graasp/graasp-deploy
event-type: update-staging-version
client-payload: ${{steps.set-tag.outputs.json}}

- name: Auto Tag
uses: graasp/graasp-deploy/.github/actions/auto-tag-after-release@v1
with:
releases_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
Empty file.
Binary file added .jspsych-builder/assets/images/hand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .jspsych-builder/assets/images/left.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .jspsych-builder/assets/images/right.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .jspsych-builder/assets/images/tip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d194820

Please sign in to comment.