Skip to content

Commit 44296b3

Browse files
chore: initial commit
0 parents  commit 44296b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+9045
-0
lines changed

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
extends: ['@fingerprintjs/eslint-config-dx-team'],
3+
ignorePatterns: ['dist/*'],
4+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Orkuncakilkaya

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
open-pull-requests-limit: 0
8+
commit-message:
9+
prefix: "build(deps)"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Analyze Commit Messages
2+
on:
3+
pull_request:
4+
5+
permissions:
6+
pull-requests: write
7+
contents: write
8+
jobs:
9+
analyze-commits:
10+
name: Generate docs and coverage report
11+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/analyze-commits.yml@v1

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint, build and test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- rc
7+
pull_request:
8+
jobs:
9+
build-and-check:
10+
name: Build project and run CI checks
11+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/build-typescript-project.yml@v1
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Check coverage for PR
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
run-tests-check-coverage:
8+
name: Run tests & check coverage
9+
permissions:
10+
checks: write
11+
pull-requests: write
12+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/coverage-diff.yml@v1

.github/workflows/coverage.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
coverage-report:
10+
name: Coverage report
11+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/docs-and-coverage.yml@v1
12+
with:
13+
skip-docs-step: true
14+
prepare-gh-pages-commands: |
15+
mv coverage/lcov-report/* ./gh-pages

.github/workflows/create-pr.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Create PR
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
create-pr:
10+
name: Create PR
11+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/create-pr.yml@v1
12+
with:
13+
target_branch: ${{ github.event.release.prerelease && 'main' || 'rc' }}
14+
tag_name: ${{ github.event.release.tag_name }}
15+
prerelease: ${{ github.event.release.prerelease }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Daily E2E Test
2+
3+
on:
4+
schedule:
5+
- cron: '30 1 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-test-e2e-mock:
10+
runs-on: ubuntu-20.04
11+
name: Test e2e for PR using mock app
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: 'Install pnpm'
15+
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
16+
with:
17+
cache: 'pnpm'
18+
version: 8
19+
- name: Install node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version-file: '.node-version'
23+
- name: Install dependencies
24+
run: pnpm install
25+
- name: Run test
26+
run: pnpm test:mock-e2e
27+
env:
28+
TEST_DOMAIN: 'https://${{secrets.FPJS_FASTLY_MOCK_TEST_DOMAIN}}'
29+
RESULT_PATH: ${{secrets.RESULT_PATH}}
30+
AGENT_PATH: ${{secrets.AGENT_PATH}}
31+
API_URL: ${{secrets.MOCK_FPCDN}}
32+
report-status:
33+
needs: build-and-test-e2e-mock
34+
if: always()
35+
uses: fingerprintjs/dx-team-toolkit/.github/workflows/report-workflow-status.yml@v1
36+
with:
37+
notification_title: 'Fastly Compute E2E Test: {status_message}'
38+
job_status: ${{ needs.build-and-test-e2e-mock.result }}
39+
secrets:
40+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/mock-e2e-pr.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Test e2e for PR
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check-changed-files:
8+
runs-on: ubuntu-20.04
9+
name: Check changed files
10+
outputs:
11+
NEED_TO_RUN_TESTS: ${{ steps.decision.outputs.NEED_TO_RUN_TESTS }}
12+
steps:
13+
- name: Git clone
14+
uses: actions/checkout@v4
15+
- name: Get changed files
16+
id: decision
17+
run: |
18+
git fetch origin $GITHUB_BASE_REF
19+
diff=$(git diff --name-only origin/$GITHUB_BASE_REF..HEAD)
20+
echo $diff
21+
needToRunTests=false
22+
for changed_file in $diff; do
23+
if [[ ${changed_file} =~ ^(src|plugins)\/.+$ ]]; then
24+
needToRunTests=true
25+
fi
26+
if [[ ${changed_file} =~ ^\.github\/workflows\/.+$ ]]; then
27+
needToRunTests=true
28+
fi
29+
done
30+
echo $needToRunTests
31+
echo NEED_TO_RUN_TESTS=${needToRunTests} >> $GITHUB_OUTPUT
32+
build-and-test-e2e-mock:
33+
runs-on: ubuntu-20.04
34+
name: Test e2e for PR using mock app
35+
needs: check-changed-files
36+
if: needs['check-changed-files'].outputs.NEED_TO_RUN_TESTS == 'true'
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: 'Install pnpm'
40+
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
41+
with:
42+
cache: 'pnpm'
43+
version: 8
44+
- name: Install node
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version-file: '.node-version'
48+
- name: Install dependencies
49+
run: pnpm install
50+
- name: Extract Branch Name
51+
id: extract-branch
52+
run: |
53+
echo SUBDOMAIN=mock-$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
54+
- name: Set up Fastly CLI
55+
uses: fastly/compute-actions/setup@v8
56+
- name: Package Fastly WASM File
57+
uses: fastly/compute-actions/build@v8
58+
with:
59+
verbose: true
60+
env:
61+
CONFIG_STORE_NAME: "E2ETest"
62+
- name: Deploy
63+
id: deploy
64+
env:
65+
SERVICE_NAME: "${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}"
66+
DEFAULT_ORIGIN: ${{secrets.DEFAULT_ORIGIN}}
67+
FASTLY_API_TOKEN: ${{secrets.FASTLY_API_TOKEN}}
68+
FPJS_BACKEND_URL: ${{secrets.MOCK_FPCDN}}
69+
FPCDN_URL: ${{secrets.MOCK_FPCDN}}
70+
CONFIG_STORE_NAME: "E2ETest"
71+
run: pnpm run ci
72+
- name: Wait for 60s
73+
shell: bash
74+
run: sleep 60s
75+
- name: Run test
76+
run: pnpm test:mock-e2e
77+
env:
78+
TEST_DOMAIN: 'https://fpjs-fastly-${{steps.extract-branch.outputs.SUBDOMAIN}}.edgecompute.app'
79+
INTEGRATION_PATH: ${{secrets.INTEGRATION_PATH}}
80+
RESULT_PATH: ${{secrets.RESULT_PATH}}
81+
AGENT_PATH: ${{secrets.AGENT_PATH}}
82+
API_URL: ${{secrets.MOCK_FPCDN}}

0 commit comments

Comments
 (0)