upgrade tests #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Deno then run Deno lint and test. | ||
# For more information see: https://github.com/denoland/setup-deno | ||
name: Deno Deploy & Test | ||
on: | ||
push: | ||
branches: ["main","test"] | ||
pull_request: | ||
branches: ["main","test"] | ||
permissions: | ||
id-token: write # Needed for auth with Deno Deploy | ||
contents: read # Needed to clone the repository | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
DENO_DIR: deno_dir | ||
CHROMIUM_PATH: deno_dir/deno_puppeteer/chromium/ | ||
steps: | ||
- name: Setup repo | ||
uses: actions/checkout@v3 | ||
- name: Setup .env secrets file | ||
run: echo $ENV_GITHUB_ACTIONS | base64 -d > .env | ||
env: | ||
ENV_GITHUB_ACTIONS: ${{ secrets.ENV_GITHUB_ACTIONS }} | ||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
- name: Verify formatting | ||
run: deno fmt --check | ||
# - name: Run linter | ||
# run: deno lint | ||
- name: Cache Deno dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
# The Chrome install gets cached in here too... | ||
key: denoDeps-${{ hashFiles('deno.lock') }} | ||
path: ${{ env.DENO_DIR }} | ||
- name: Cache puppeteer | ||
uses: actions/cache@v3 | ||
with: | ||
key: puppeteer_${{ runner.os }}_v16_2_0 | ||
path: ${{ env.CHROMIUM_PATH }} | ||
- name: Install Chromium for Puppeteer | ||
run: PUPPETEER_PRODUCT=chrome deno run -A --unstable https://deno.land/x/puppeteer@16.2.0/install.ts | ||
- name: Run tests | ||
run: deno test -A | ||
- name: Build step | ||
run: "deno task build" # 📝 Update the build command(s) if necessary | ||
- name: Upload to Deno Deploy | ||
uses: denoland/deployctl@v1 | ||
with: | ||
project: "fresh-strapi" # 📝 Update the deploy project name if necessary | ||
entrypoint: "./main.ts" # 📝 Update the entrypoint if necessary |