name: CI on: push: workflow_dispatch: jobs: pre_job: runs-on: ubuntu-latest # Map a step output to a job output outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: - id: skip_check uses: fkirc/skip-duplicate-actions@master with: github_token: ${{ github.token }} paths_ignore: '["**/*.md"]' ci: needs: pre_job if: ${{ needs.pre_job.outputs.should_skip == 'false' }} runs-on: ubuntu-latest # For enterprise users, macos is 10x more expensive (as of 9/2020) timeout-minutes: 30 steps: - uses: actions/setup-node@v1 with: node-version: 14.x - uses: actions/checkout@v2 with: token: ${{ secrets.CI_PAT }} # Recursive workflow-triggering does not work with regular GitHub token - uses: actions/cache@v2 with: path: '**/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - run: pwd && ls -la - run: yarn install --frozen-lockfile - id: skip_check uses: fkirc/skip-duplicate-actions@master with: github_token: ${{ github.token }} cancel_others: 'false' paths: '["**/public/locales/**"]' - name: Re-generate translations if: ${{ steps.skip_check.outputs.should_skip == 'false' }} run: | git diff --exit-code ./translate.sh git config --global user.name "Automated Translations" git config --global user.email "translation.bot@github.com" git commit -am "Re-generate translations" || true git diff --exit-code git push origin - run: yarn run lint - run: yarn run build - run: git submodule update --init - run: npx cap sync android - name: Android Tests run: | git fetch origin --depth=1 ${{ env.ref-branch }} if ! git diff --name-only origin/${{ env.ref-branch }} | grep android; then echo "Skip Android tests because nothing changed" && exit 0 fi cd android && pwd ./gradlew lintProductionRelease ./gradlew app:testProductionReleaseUnitTest env: ref-branch: "develop" #- name: Setup tmate session # if: ${{ failure() }} # uses: mxschmitt/action-tmate@v2