Skip to content

Remove use of cf pages #1780

Remove use of cf pages

Remove use of cf pages #1780

Workflow file for this run

name: wc:tests
on:
pull_request:
branches:
- main
paths:
- "packages/web-client/**"
- ".github/workflows/webclient-deploy.yml"
- ".github/workflows/webclient-test.yml"
- ".github/workflows/webclient-test-deploy.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
issues: write
pull-requests: write
jobs:
svelte-check:
if: github.event.pull_request.draft == false
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm install
- name: Run svelte-check
run: npm run wc:check
deploy-fly-staging:
needs: ["svelte-check"]
environment:
name: pr-${{ github.event.number }}
url: ${{ steps.deploy.outputs.url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm install
- name: Deploy staging build
id: deploy
uses: superfly/[email protected]
env:
FLY_API_TOKEN: ${{ secrets.FLYIO_KIT_DEPLOY_GH_ACTION }}
FLY_ORG: gobazzinga-inc-584
with:
config: "wc.staging.fly.toml"
lighthouse-cypress-vitest:
needs: ["svelte-check"]
if: github.event.pull_request.draft == false
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm install
- name: Echo expression
run: echo ${{ (github.actor != 'dependabot[bot]' && 'wc:test:record') || 'wc:test' }}
- name: Add Rust wasm target
run: rustup target add wasm32-unknown-unknown
- name: Install DFX
run: DFX_VERSION=0.16.1 sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
- name: Cache rust dependencies, build output and DFX build cache
uses: actions/cache@v4
id: dfx-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./packages/hot-or-not-backend-canister/target/
./packages/hot-or-not-backend-canister/.dfx/
key: ${{ runner.os }}-testing-${{ hashFiles('**/Cargo.lock') }}
- name: Start DFX Server
if: always()
working-directory: ./packages/hot-or-not-backend-canister
run: dfx start --background
- name: Provision local canister IDs for the canisters
working-directory: ./packages/hot-or-not-backend-canister
run: |
dfx canister create --no-wallet configuration
dfx canister create --no-wallet individual_user_template
dfx canister create --no-wallet user_index
dfx canister create --no-wallet post_cache
- name: Install canisters
if: always()
working-directory: ./packages/hot-or-not-backend-canister
run: ./scripts/canisters/local_deploy/install_all_canisters.sh -si
- name: Test DFX connection
if: always()
run: dfx ping http://localhost:4943
# - name: Run vitest
# run: |
# set -euxo pipefail
# npm run wc:test:vi
- name: Run Cypress tests
uses: cypress-io/github-action@v5
with:
browser: chrome
project: ./packages/web-client
build: npm run wc:build
start: npm run wc:preview
command: npm run ${{ (github.actor != 'dependabot[bot]' && 'wc:test:record') || 'wc:test' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PROJECT_ID: uv7vm5
TEST_HOST: http://localhost:4173
- name: Lighthouse CI check
run: |
npm run wc:build
npm install -g @lhci/cli
lhci_host=http://localhost:4174 lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
- name: Stop DFX Server
run: dfx stop
if: always()
- uses: actions/upload-artifact@v4
if: always()
with:
name: lighthouse-ci-report
path: lhci_report
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: packages/web-client/coverage/
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-report
path: packages/web-client/cypress/
retention-days: 7
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-report
path: packages/web-client/cypress/reports/mochawesome-report
retention-days: 7