-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
513 additions
and
484 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
name: Run all tests | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
FEATURE_PRIVACY_SETTINGS: "true" | ||
FEATURE_EXPERIMENTAL_SETTINGS: "true" | ||
FEATURE_BANXA: "true" | ||
FEATURE_LAYERSWAP: "true" | ||
FEATURE_ORBITER: "true" | ||
FEATURE_VERIFIED_DAPPS: "false" | ||
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }} | ||
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }} | ||
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }} | ||
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }} | ||
UPLOAD_SENTRY_SOURCEMAPS: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: "yarn" | ||
|
||
- name: Setup project | ||
run: yarn setup | ||
|
||
- name: Build extension | ||
run: yarn lerna run --scope @argent-x/extension build | ||
|
||
- name: Cache build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
test-unit: | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
|
||
services: | ||
devnet: | ||
image: shardlabs/starknet-devnet:latest-seed0 | ||
ports: | ||
- 5050:5050 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: "yarn" | ||
|
||
- name: Restore cached build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Run tests | ||
run: yarn test:ci | ||
|
||
test-e2e: | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
|
||
services: | ||
devnet: | ||
image: argentlabs-argent-x.jfrog.io/e2e-starknet-devnet:latest | ||
ports: | ||
- 5050:5050 | ||
credentials: | ||
username: ${{ secrets.JFROG_USERNAME }} | ||
password: ${{ secrets.JFROG_PASSWORD }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: "yarn" | ||
|
||
- name: Restore cached build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- name: Install Playwright Browsers | ||
run: npx playwright install chromium | ||
|
||
- name: Run e2e tests | ||
run: xvfb-run --auto-servernum yarn test:e2e | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: test-results | ||
path: | | ||
packages/extension/test-results/ | ||
packages/extension/e2e/artifacts/playwright/ | ||
packages/extension/e2e/artifacts/reports/ | ||
retention-days: 5 | ||
|
||
sonar: | ||
runs-on: ubuntu-latest | ||
needs: [setup] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: "yarn" | ||
|
||
- name: Restore cached build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | ||
|
||
artifacts: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'pull_request' }} # Run only for pull requests | ||
needs: [setup, test-unit, test-e2e] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
cache: "yarn" | ||
|
||
- name: Restore cached build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- name: Set filename prefix | ||
run: echo "FILENAME_PREFIX=$(echo argent-extension-${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV | ||
|
||
- name: Create chrome zip | ||
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-chrome.zip" .) | ||
|
||
- name: Upload artifacts for chrome | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.FILENAME_PREFIX }}-chrome.zip | ||
path: "*-chrome.zip" | ||
retention-days: 5 | ||
|
||
- name: Build Firefox version | ||
run: MANIFEST_VERSION=v2 yarn --cwd packages/extension build | ||
|
||
- name: Create firefox zip | ||
run: (cd ./packages/extension/dist && zip -r "../../../${{ env.FILENAME_PREFIX }}-firefox.zip" .) | ||
|
||
- name: Check bundlesize for firefox | ||
run: yarn run bundlewatch | ||
|
||
- name: Upload artifacts for firefox | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.FILENAME_PREFIX }}-firefox.zip | ||
path: "*-firefox.zip" | ||
retention-days: 5 | ||
|
||
- name: Set GHA_BRANCH | ||
run: echo "GHA_BRANCH=$(echo $GITHUB_REF | awk -F / '{print $3}')" >> $GITHUB_ENV | ||
|
||
- name: Comment PR | ||
continue-on-error: true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr comment ${{ env.GHA_BRANCH }} --body "[Builds for local testing](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" |
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
Oops, something went wrong.