diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f2eb35c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: ci + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + ci: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node: [14] + + steps: + - name: Checkout ๐Ÿ›Ž + uses: actions/checkout@master + + - name: Setup node env ๐Ÿ— + uses: actions/setup-node@v2.1.5 + with: + node-version: ${{ matrix.node }} + check-latest: true + + - name: Get yarn cache directory path ๐Ÿ›  + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache node_modules ๐Ÿ“ฆ + uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป + run: yarn + + - name: Run linter ๐Ÿ‘€ + run: yarn lint + + - name: Run tests ๐Ÿงช + run: yarn test + + - name: Run tests in new-web directory ๐Ÿ“‚ + working-directory: new-web + run: yarn test