From 8bbbe270b33a364c62fa4abcdf2b1d700ee55e87 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sat, 10 Oct 2020 11:51:50 +0900 Subject: [PATCH 1/3] feat: setup github actions --- .circleci/config.yml | 154 ------------------ .github/workflows/workflows/ci.yml | 111 +++++++++++++ .../workflows/{ => workflows}/windows-ci.yml | 0 3 files changed, 111 insertions(+), 154 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/workflows/ci.yml rename .github/workflows/{ => workflows}/windows-ci.yml (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index b5d9a45c..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,154 +0,0 @@ -# ------------------------- -# ALIASES -# ------------------------- - -aliases: - # CACHE - - &restore-gradle-cache - keys: - - gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }} - - &save-gradle-cache - paths: - - ~/.gradle - key: gradle-cache-{{ checksum "android/build.gradle" }}-{{ checksum "example/android/build.gradle" }}-{{ checksum "example/android/app/build.gradle" }} - - # ANALYSE - - &eslint - name: ESLint Checks - command: yarn lint - - - &type-check - name: TypeScript Checks - command: yarn tsc - - - &flow - name: Flow TypeChecks - command: yarn flow - - - &jest - name: Jest Unit Tests - command: yarn test - -# ------------------------- -# JOBS -# ------------------------- -version: 2.1 -orbs: - rn: react-native-community/react-native@2.0.1 - -jobs: - # Set up a Linux environment for downstream jobs - linux-checkout: - executor: - name: rn/linux_js - node_version: '10' - steps: - - attach_workspace: - at: . - - checkout - - rn/yarn_install - - persist_to_workspace: - root: . - paths: . - - eslint: - executor: - name: rn/linux_js - node_version: '10' - steps: - - attach_workspace: - at: . - - run: *eslint - - type-check: - executor: - name: rn/linux_js - node_version: '10' - steps: - - attach_workspace: - at: . - - run: *type-check - - flow: - executor: - name: rn/linux_js - node_version: '10' - steps: - - attach_workspace: - at: . - - run: *flow - - jest: - executor: - name: rn/linux_js - node_version: '10' - steps: - - attach_workspace: - at: . - - run: *jest - - android-compile: - executor: rn/linux_android - steps: - - attach_workspace: - at: . - - restore_cache: *restore-gradle-cache - - run: - name: Accept Android licences - command: |- - yes | sdkmanager --licenses || exit 0 - yes | sdkmanager --update || exit 0 - - run: - name: Build Android Example App and Library - command: |- - cd example/android - ./gradlew clean assembleDebug - - save_cache: *save-gradle-cache - - ios-checkout: - executor: rn/macos - steps: - - checkout - - rn/yarn_install - - persist_to_workspace: - root: . - paths: . - - ios-compile: - executor: rn/macos - steps: - - attach_workspace: - at: . - - run: - name: Build example app - command: |- - react-native run-ios --project-path example/ios - -# ------------------------- -# WORKFLOWS -# ------------------------- -workflows: - version: 2 - Test: - jobs: - - linux-checkout - - eslint: - requires: - - linux-checkout - - type-check: - requires: - - linux-checkout - - jest: - requires: - - linux-checkout - - flow: - requires: - - linux-checkout - - android-compile: - requires: - - linux-checkout -# Disabled until we have macOS containers enabled -# - ios-checkout -# - ios-compile: -# requires: -# - ios-checkout diff --git a/.github/workflows/workflows/ci.yml b/.github/workflows/workflows/ci.yml new file mode 100644 index 00000000..55fc2c65 --- /dev/null +++ b/.github/workflows/workflows/ci.yml @@ -0,0 +1,111 @@ +name: Build +on: pull_request + +jobs: + lint: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: ESLint Checks + run: yarn lint + flow: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: FlowType Check + run: yarn flow + tsc: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: TypeScript type check + run: yarn type-check + android: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: Build Android Example App and Library + run: cd example/android && ./gradlew clean assembleDebug + ios: + runs-on: macos-latest + strategy: + matrix: + node-version: [10] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: Install Podfiles + run: cd example && npx pod-install + - name: Build example app + run: yarn ios diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/workflows/windows-ci.yml similarity index 100% rename from .github/workflows/windows-ci.yml rename to .github/workflows/workflows/windows-ci.yml From 2302bd8a0d8fce04e51b930a25aba3734cc490e7 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sat, 10 Oct 2020 11:56:51 +0900 Subject: [PATCH 2/3] fix: workflow folder structure --- .github/workflows/{workflows => }/ci.yml | 0 .github/workflows/{workflows => }/windows-ci.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{workflows => }/ci.yml (100%) rename .github/workflows/{workflows => }/windows-ci.yml (100%) diff --git a/.github/workflows/workflows/ci.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/workflows/ci.yml rename to .github/workflows/ci.yml diff --git a/.github/workflows/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml similarity index 100% rename from .github/workflows/workflows/windows-ci.yml rename to .github/workflows/windows-ci.yml From 0ccde26de41ca6427389a1bda12c14af589a65d3 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sat, 10 Oct 2020 14:52:29 +0900 Subject: [PATCH 3/3] docs: replace README badge --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f906ad0..bb502fdb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # @react-native-community/progress-view [![Build Status][build-badge]][build] +[![Windows CI Status][windows-ci-badge]][build] [![Version][version-badge]][package] ![Platforms][support-badge] [![MIT License][license-badge]][license] @@ -211,8 +212,9 @@ Turns progress bar into an indeterminate progress bar The library is released under the MIT license. For more information see [`LICENSE`](/LICENSE). -[build-badge]: https://img.shields.io/circleci/project/github/react-native-community/progress-view/master.svg?style=flat-square -[build]: https://circleci.com/gh/react-native-community/progress-view +[build-badge]: https://github.com/react-native-community/progress-view/workflows/Build/badge.svg +[windows-ci-badge]:https://github.com/react-native-community/progress-view/workflows/Windows%20CI/badge.svg +[build]: https://github.com/react-native-community/progress-view/actions [version-badge]: https://img.shields.io/npm/v/@react-native-community/progress-view.svg?style=flat-square [package]: https://www.npmjs.com/package/@react-native-community/progress-view [support-badge]:https://img.shields.io/badge/platforms-ios%20|%20macos-lightgrey.svg?style=flat-square