From ee9255f0bcdc9ea9f76540027a46a2c49c646a19 Mon Sep 17 00:00:00 2001 From: Simon Lightfoot Date: Fri, 20 Dec 2024 19:40:21 +0000 Subject: [PATCH] feat: add Dart github action #7 --- .github/workflows/main.yaml | 56 ++++++++++++++++++++++++++++++++++ .github/workflows/publish.yaml | 16 ++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/main.yaml create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..27371da --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,56 @@ +name: Push/PR Checks + +on: + push: + branches: [ "main", "feat/7-github-actions" ] + pull_request: + branches: [ "main" ] + +jobs: + pr_check: + name: PR Check Build + runs-on: ubuntu-latest + + steps: + - name: Checkout repo (self) + uses: actions/checkout@v4 + + - name: Install flutter + uses: flutter-actions/setup-flutter@v4 + with: + version: '3.10.0' + + - name: 'Install tools: melos and fvm' + run: dart pub global activate melos && dart pub global activate fvm + + - name: Install top-level dependencies + run: dart pub get + + - name: Run melos + run: melos bs && melos run get + + - name: Verify formatting of clerk_auth + run: dart format --output=none --set-exit-if-changed . + working-directory: packages/clerk_auth + + - name: Verify formatting of clerk_flutter + run: dart format --output=none --set-exit-if-changed . + working-directory: packages/clerk_flutter + + - name: Analyze clerk_auth + run: dart analyze + working-directory: packages/clerk_auth + + - name: Analyze clerk_flutter + run: flutter analyze + working-directory: packages/clerk_flutter + + - name: Prepare test environment + env: + TEST_ENV_BASE64: ${{ secrets.TEST_ENV_BASE64 }} + run: | + echo $TEST_ENV_BASE64 | base64 --decode > packages/clerk_auth/.env.test + + - name: Run tests in clerk_auth + run: dart test + working-directory: packages/clerk_auth diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..ac149bf --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,16 @@ +name: Publish Packages + +on: workflow_call + +jobs: + publish_clerk_auth: + name: Publish clerk_auth package + uses: dart-lang/setup-dart/.github/workflows/publish.yml@main + with: + working-directory: packages/clerk_auth + publish_clerk_flutter: + name: Publish clerk_flutter package + needs: [publish_clerk_auth] + uses: dart-lang/setup-dart/.github/workflows/publish.yml@main + with: + working-directory: packages/clerk_flutter