Skip to content

Commit

Permalink
adds cache step to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
emrergin committed Feb 22, 2024
1 parent 3212c42 commit 590848f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ on:
- main

jobs:
cache:
runs-on: ubuntu-latest
steps:
uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
build:
runs-on: ubuntu-latest
env:
Expand Down
4 changes: 1 addition & 3 deletions src/components/Experiment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import Round from "@/components/Round";
import Demographics from "@/components/Demographics";
import Gps from "@/components/Gps";

import { Phase, GpsQuestion } from "@/utilities/types";

import { SessionType } from "@/pages";
import { Phase, GpsQuestion, SessionType } from "@/utilities/types";

function Experiment({ data }: { data: SessionType }) {
const [participant, setParticipant] = useState<Participant | {}>({});
Expand Down
10 changes: 3 additions & 7 deletions src/components/Experiment2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import Intro3 from "./Intro3";
import TopBar from "@/components/TopBar";

import { Participant } from "@prisma/client";
import { useRef, useState } from "react";
import { useState } from "react";

import Round from "@/components/Round";
import Demographics from "@/components/Demographics";
import Gps from "@/components/Gps";

import { Phase, GpsQuestion } from "@/utilities/types";
import Round2 from "./Round2";

// import { SessionType } from "@/pages";

function Experiment2() {
const [participant, setParticipant] = useState<Participant | {}>({});

Expand All @@ -28,9 +25,8 @@ function Experiment2() {
setPhase(Phase.Intro2);
}

// const [phase, setPhase] = useState<Phase>(Phase.Intro);
const [phase, setPhase] = useState<Phase>(Phase.Main);
// const randomizedDraws = useRef(data.drawn_balls);
const [phase, setPhase] = useState<Phase>(Phase.Intro);
// const [phase, setPhase] = useState<Phase>(Phase.Main);
const [points, setPoints] = useState(0);
const [currentRound, setCurrentRound] = useState(0);
const [gpsQuestion, setGpsQuestion] = useState<GpsQuestion>("generalrisk");
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ export default function Home({
<Group mt="xs">
<Radio value="QSR" label="QSR" />
<Radio value="BSR" label="BSR" />
{/* <Radio value="QSRN" label="QSRN" /> */}
{/* <Radio value="BSRN" label="BSRN" /> */}
<Radio value="QSRN" label="QSR2" />
<Radio value="BSRN" label="BSR2" />
</Group>
</Radio.Group>
<TextInput
Expand Down

0 comments on commit 590848f

Please sign in to comment.