unit-tests.yml
1 name: Run unit tests 2 on: [pull_request, workflow_dispatch] 3 4 jobs: 5 unit-tests: 6 runs-on: ubuntu-latest 7 steps: 8 - name: Check out code 9 uses: actions/checkout@v2 10 11 - uses: actions/setup-node@v3 12 with: 13 node-version: 20 14 cache: 'npm' 15 16 - name: Cache dependencies 17 uses: actions/cache@v2 18 with: 19 path: ~/.npm 20 key: npm-${{ hashFiles('package-lock.json') }} 21 restore-keys: npm- 22 23 - name: Populate .env file 24 uses: SpicyPizza/create-envfile@v1.3 25 with: 26 envkey_PUBLIC_NETWORK: 5 27 envkey_GQL_URL: https://drips-api-mainnet-s1.up.railway.app/ 28 envkey_GQL_ACCESS_TOKEN: ${{ secrets.GQL_ACCESS_TOKEN }} 29 envkey_PUBLIC_PINATA_GATEWAY_URL: http://localhost:3000 30 31 - name: Install dependencies 32 run: npm ci 33 34 - name: Build GQL types 35 run: npm run build:graphql 36 37 - name: Svelte Kit Sync 38 run: npx svelte-kit sync 39 40 - name: Run tests 41 run: npm run test:unit