-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (67 loc) · 2.57 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI Workflow for API Integration Testing
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
schedule:
# Runs at 10:00 UTC from March to November (PDT, UTC-7)
- cron: '0 10 * 3-11 *'
# Runs at 11:00 UTC from November to March (PST, UTC-8)
- cron: '0 11 * 1-3,11,12 *'
jobs:
Timestamp:
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main
test-and-publish:
needs: [ Timestamp ]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install Dependencies
run: pnpm install
- name: Lint
run: pnpm eslint .
# Ensure you have a lint script in your package.json
- name: Run Tests On Sepolia
continue-on-error: true
run: |
echo "Load environment variables"
rm .env && touch .env
echo API_BASE_URL=${{ secrets.API_BASE_URL }} > .env
echo API_KEY=${{ secrets.API_KEY }} >> .env
test_env=sepolia npx playwright test
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./playwright-report-sepolia
publish_branch: gh-pages
keep_files: true
- name: Push Slack Notification
uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main
with:
short-desc: "${{ github.repository }}: API Integration Tests have been completed. Check the results at https://storyprotocol.github.io/api-integration-tests/index.html"
title: "API Integration Test Results"
img-url: "http://www.quickmeme.com/img/b9/b9848df257b95cd39585368475a4b4e4a3a8c774f7390226daecb79b912087ad.jpg"
img-alt-text: "API Integration Test Results"
secrets:
channel-name: ${{ secrets.SLACK_CHANNEL_ID_API_INTEGRATION_TESTS }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Upload Test Results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
# if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
name: sepolia-test-reports
path: |
./playwright-report-sepolia/index.html