From 741732be54f077593c0f038e3cc970f92c719825 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Sat, 15 Oct 2022 16:25:21 +0530 Subject: [PATCH] refactor: rename workflow files (#48059) * refactor: rename workflow files * fix: temporarily disable the mobile workflow --- .github/workflows/e2e-mobile.yml | 73 +++++++++++++++++++ ...ss-third-party.yml => e2e-third-party.yml} | 5 +- .../workflows/{cypress.yml => e2e-web.yml} | 2 +- .../{autoclose.yml => github-autoclose.yml} | 0 .../{labeler.yaml => github-labeler.yaml} | 0 ...slation.yml => github-no-i18n-via-prs.yml} | 0 .../workflows/{spam.yml => github-spam.yml} | 0 ...8n-builds.yml => i18n-validate-builds.yml} | 0 .../{i18n-prs.yml => i18n-validate-prs.yml} | 0 9 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/e2e-mobile.yml rename .github/workflows/{cypress-third-party.yml => e2e-third-party.yml} (94%) rename .github/workflows/{cypress.yml => e2e-web.yml} (99%) rename .github/workflows/{autoclose.yml => github-autoclose.yml} (100%) rename .github/workflows/{labeler.yaml => github-labeler.yaml} (100%) rename .github/workflows/{no-prs-to-translation.yml => github-no-i18n-via-prs.yml} (100%) rename .github/workflows/{spam.yml => github-spam.yml} (100%) rename .github/workflows/{i18n-builds.yml => i18n-validate-builds.yml} (100%) rename .github/workflows/{i18n-prs.yml => i18n-validate-prs.yml} (100%) diff --git a/.github/workflows/e2e-mobile.yml b/.github/workflows/e2e-mobile.yml new file mode 100644 index 00000000000..2507d494ded --- /dev/null +++ b/.github/workflows/e2e-mobile.yml @@ -0,0 +1,73 @@ +name: CI - E2E - Mobile (webview) Browser +on: + workflow_dispatch: + # push: + # paths-ignore: + # - 'docs/**' + # branches-ignore: + # - 'renovate/**' + # pull_request: + # paths-ignore: + # - 'docs/**' + +jobs: + mobile-test: + name: Test curriculum for mobile app + runs-on: ubuntu-20.04 + + steps: + - name: Checkout Source Files + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + + - name: Checkout mobile + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + with: + repository: freeCodeCamp/mobile + path: mobile + + - name: Use Node.js 16.x + uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3 + with: + node-version: 16.x + cache: 'npm' + + - name: Setup Flutter 3.0.x + uses: subosito/flutter-action@9d48f4efd5460d7013af812069d08b23f37aed20 # tag=v2 + with: + flutter-version: '3.0.x' + channel: 'stable' + cache: true + cache-key: flutter-3.0.x + cache-path: ${{ runner.tool_cache }}/flutter + + - name: Set freeCodeCamp Environment Variables + run: cp sample.env .env + + - name: Install and Build + run: | + npm ci + npm run create:config + npm run build:curriculum + + - name: Generate mobile test files + run: | + cd mobile/mobile-app + echo "DEVELOPMENTMODE=true" > .env + echo "NEWSURL=https://www.freecodecamp.org/news/ghost/api/v3/content/" >> .env + flutter pub get + flutter test test/widget_test.dart + + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: ${{ env.CYPRESS_RECORD_KEY != 0 }} + start: npx serve + wait-on: http://localhost:3000 + wait-on-timeout: 1200 + config: retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/mobile/mobile-app/generated-tests/ + browser: chrome + headless: true + spec: cypress/integration/mobile-learn/test-challenges.js + env: + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cypress-third-party.yml b/.github/workflows/e2e-third-party.yml similarity index 94% rename from .github/workflows/cypress-third-party.yml rename to .github/workflows/e2e-third-party.yml index 2bcec63db92..29ea5f9405f 100644 --- a/.github/workflows/cypress-third-party.yml +++ b/.github/workflows/e2e-third-party.yml @@ -1,4 +1,7 @@ -name: CI - Cypress (e2e) 3rd party donation tests +name: CI - E2E - 3rd party donation tests + +# These are only run on prod-* branches to test the 3rd party donation flow + on: push: branches: diff --git a/.github/workflows/cypress.yml b/.github/workflows/e2e-web.yml similarity index 99% rename from .github/workflows/cypress.yml rename to .github/workflows/e2e-web.yml index 5185ec45189..db49eaa5763 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/e2e-web.yml @@ -1,4 +1,4 @@ -name: CI - Cypress (e2e) tests +name: CI - E2E - Web browser on: push: paths-ignore: diff --git a/.github/workflows/autoclose.yml b/.github/workflows/github-autoclose.yml similarity index 100% rename from .github/workflows/autoclose.yml rename to .github/workflows/github-autoclose.yml diff --git a/.github/workflows/labeler.yaml b/.github/workflows/github-labeler.yaml similarity index 100% rename from .github/workflows/labeler.yaml rename to .github/workflows/github-labeler.yaml diff --git a/.github/workflows/no-prs-to-translation.yml b/.github/workflows/github-no-i18n-via-prs.yml similarity index 100% rename from .github/workflows/no-prs-to-translation.yml rename to .github/workflows/github-no-i18n-via-prs.yml diff --git a/.github/workflows/spam.yml b/.github/workflows/github-spam.yml similarity index 100% rename from .github/workflows/spam.yml rename to .github/workflows/github-spam.yml diff --git a/.github/workflows/i18n-builds.yml b/.github/workflows/i18n-validate-builds.yml similarity index 100% rename from .github/workflows/i18n-builds.yml rename to .github/workflows/i18n-validate-builds.yml diff --git a/.github/workflows/i18n-prs.yml b/.github/workflows/i18n-validate-prs.yml similarity index 100% rename from .github/workflows/i18n-prs.yml rename to .github/workflows/i18n-validate-prs.yml