Clean monorepo #496
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
name: CI | ||
on: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
env: | ||
WORK_DIR: packages/starknet | ||
jobs: | ||
lint: | ||
steps: | ||
Check failure on line 13 in .github/workflows/ci.yaml
|
||
- uses: actions/checkout@v2 | ||
- uses: dart-lang/[email protected] | ||
- uses: bluefireteam/melos-action@v3 | ||
- run: melos bootstrap | ||
- run: melos format:check | ||
- run: melos analyze | ||
test:unit: | ||
needs: lint | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dart-lang/[email protected] | ||
- uses: bluefireteam/melos-action@v3 | ||
- run: melos bootstrap | ||
- run: melos test:dart:unit | ||
test-integration-testnet: | ||
needs: analyze | ||
defaults: | ||
run: | ||
working-directory: ${{ env.WORK_DIR }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dart-lang/[email protected] | ||
with: | ||
sdk: stable | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Run tests on testnet | ||
run: dart test -t integration-testnet --exclude-tags='integration' | ||
test-integration: | ||
needs: analyze | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# | ||
# devnet setup | ||
# | ||
- name: Setup python | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
- name: Load cached env | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install Poetry dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != true | ||
run: poetry install --no-interaction | ||
- name: Start devnet | ||
uses: JarvusInnovations/background-action@v1 | ||
id: start-devnet | ||
with: | ||
run: | | ||
poetry run devnet start & | ||
wait-on: http://localhost:5050/is_alive | ||
tail: true | ||
log-output-resume: stderr | ||
wait-for: 1m | ||
log-output: stderr,stdout | ||
log-output-if: failure | ||
- name: Setup devnet | ||
run: poetry run devnet setup | ||
# | ||
# End of devnet setup | ||
# | ||
- uses: dart-lang/[email protected] | ||
with: | ||
sdk: stable | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
working-directory: ${{ env.WORK_DIR }} | ||
- name: Run tests on devnet | ||
env: | ||
NETWORK: devnet | ||
run: dart test -t integration | ||
working-directory: ${{ env.WORK_DIR }} | ||
publish: | ||
if: github.event.pull_request.head.repo.fork == false | ||
needs: test-integration | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
# Only publishes if package version is different from the latest published on pub.dev | ||
# See the docs: https://github.com/marketplace/actions/dart-and-flutter-package-publisher | ||
- name: "Publish package (dry run)" | ||
uses: k-paxian/dart-package-publisher@master | ||
with: | ||
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} | ||
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} | ||
skipTests: true # Tests have already been run before | ||
dryRunOnly: true | ||
relativePath: ${{ env.WORK_DIR }} |