diff --git a/.github/workflows/cloudinary_dart.yml b/.github/workflows/cloudinary_dart.yml new file mode 100644 index 00000000..e32dbb86 --- /dev/null +++ b/.github/workflows/cloudinary_dart.yml @@ -0,0 +1,51 @@ +name: Cloudinary Dart CI + +on: + push: + branches: + - main + pull_request: + branches: + - '**' + +jobs: + dart-test: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the code + - name: Checkout Code + uses: actions/checkout@v3 + + # Step 2: Set up Dart + - name: Setup Dart + uses: dart-lang/setup-dart@v1 + with: + channel: stable + + # Step 3: Export Cloudinary URL (Before Script) + - name: Export Cloudinary URL + run: echo "CLOUDINARY_URL=$(bash tools/get_test_cloud.sh)" >> $GITHUB_ENV + + # Step 4: Run Tests for url_gen + - name: Run Tests for url_gen + working-directory: url_gen + env: + CLOUDINARY_URL: ${{ env.CLOUDINARY_URL }} + run: dart test + + # Step 5: Run Tests for api + - name: Run Tests for api + working-directory: api + env: + CLOUDINARY_URL: ${{ env.CLOUDINARY_URL }} + run: dart test + + # Cache Dart Dependencies + - name: Cache Pub Dependencies + uses: actions/cache@v3 + with: + path: ~/.pub-cache + key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }} + restore-keys: | + ${{ runner.os }}-pub-cache- diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d54c37f0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -os: - - linux -sudo: false -language: dart -dart: - - stable - -before_script: export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh); -script: - - cd url_gen - - dart test - - cd .. - - cd api - - dart test -cache: - directories: - - $HOME/.pub-cache \ No newline at end of file