diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql.yml similarity index 93% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql.yml index dc48047..25171e3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql.yml @@ -39,11 +39,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,7 +54,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,4 +68,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 443d166..17cab4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,118 +2,131 @@ name: CI on: push: - branches: [ "*" ] + branches: [master] pull_request: - branches: [ "*" ] + branches: ["*"] jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 15.x - uses: actions/setup-node@v1 - with: - node-version: "15.x" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - 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 - run: yarn install - - - name: Build - run: yarn build - lint: + name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js 15.x - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + + - name: Use Node.js 16.x + uses: actions/setup-node@v3 with: - node-version: "15.x" + node-version: 16 + - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v3 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 run: yarn install - + - name: "Lint: Prettier" run: yarn lint:prettier - name: "Lint: TypeScript" run: yarn lint:tslint && yarn lint:tsc - + test: - needs: build + name: Test runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 - - name: Use Node.js 15.x - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + + - name: Use Node.js 16.x + uses: actions/setup-node@v3 with: - node-version: "15.x" + node-version: 16 + - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v3 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 run: yarn install - + - name: "Tests: Unit" run: yarn test - + - name: "Tests: E2E" run: yarn test:e2e - + - name: Coveralls uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - + + build: + name: Build + needs: [lint, test] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v3 + 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 + run: yarn install + + - name: Build + run: yarn build + examples: + name: Build examples needs: build runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 - - name: Use Node.js 15.x - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + + - name: Use Node.js 16.x + uses: actions/setup-node@v3 with: - node-version: "15.x" + node-version: 16 + - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 + + - uses: actions/cache@v3 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -121,19 +134,19 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: yarn-cache-examples with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-examples-${{ hashFiles('examples/**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn-examples- - + - name: Install master run: yarn install - + - name: Install run: cd examples && yarn - + - name: Build run: yarn build diff --git a/README.md b/README.md index 20fca65..29f15ff 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# React <Countdown /> [![npm][npm]][npm-url] [![Build Status](https://travis-ci.com/ndresx/react-countdown.svg?branch=master)](https://travis-ci.com/ndresx/react-countdown) [![Coverage Status](https://coveralls.io/repos/github/ndresx/react-countdown/badge.svg?branch=master)](https://coveralls.io/github/ndresx/react-countdown?branch=master) +# React <Countdown /> [![npm][npm]][npm-url] [![CI: Build Status](https://img.shields.io/github/workflow/status/ndresx/react-countdown/CI)](https://github.com/ndresx/react-countdown/actions/workflows/main.yml) [![Coverage Status](https://coveralls.io/repos/github/ndresx/react-countdown/badge.svg?branch=master)](https://coveralls.io/github/ndresx/react-countdown?branch=master) A customizable countdown component for React. * [Getting Started](#getting-started)