From 4152aefe1a61f38cbe3dbfe68100f19a000640a4 Mon Sep 17 00:00:00 2001
From: Roman Dvornov <rdvornov@gmail.com>
Date: Sun, 12 Dec 2021 17:44:27 +0100
Subject: [PATCH] Replace travis with github action

---
 .github/workflows/build.yml | 55 +++++++++++++++++++++++++++++++++++++
 .travis.yml                 |  5 ----
 README.md                   |  2 +-
 3 files changed, 56 insertions(+), 6 deletions(-)
 create mode 100644 .github/workflows/build.yml
 delete mode 100644 .travis.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..a018ba8
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,55 @@
+name: Build
+
+on:
+    push:
+    pull_request:
+
+jobs:
+    lint-coverage:
+        runs-on: ubuntu-latest
+        steps:
+            - uses: actions/checkout@v2
+            - name: Setup node 16
+              uses: actions/setup-node@v2
+              with:
+                  node-version: 16
+                  cache: "npm"
+            - run: npm ci
+            - run: npm run lint
+            - run: npm run bundle-and-test
+              env:
+                  REPORTER: "min"
+            - run: npm run coverage
+              env:
+                  REPORTER: "min"
+            - name: Send coverage to Coveralls
+              uses: coverallsapp/github-action@1.1.3
+              with:
+                  github-token: ${{ secrets.GITHUB_TOKEN }}
+
+    run-tests:
+        needs: lint-coverage
+        runs-on: ubuntu-latest
+
+        strategy:
+            matrix:
+                # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
+                node_version:
+                    - 12.20.0
+                    - 14.13.0
+                    - 16
+
+        steps:
+            - uses: actions/checkout@v2
+            - name: Setup node ${{ matrix.node_version }}
+              uses: actions/setup-node@v2
+              with:
+                  node-version: ${{ matrix.node_version }}
+                  cache: "npm"
+            - run: npm ci
+            - run: npm run test
+              env:
+                  REPORTER: "min"
+            - run: npm run esm-to-cjs-and-test
+              env:
+                  REPORTER: "min"
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 5abe6f6..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-script: "npm run travis"
-node_js:
-  - 8
-  - node
diff --git a/README.md b/README.md
index 559f4ea..7123b76 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 [![NPM version](https://img.shields.io/npm/v/clap.svg)](https://www.npmjs.com/package/clap)
-[![Build Status](https://travis-ci.org/lahmatiy/clap.svg?branch=master)](https://travis-ci.org/lahmatiy/clap)
+[![Build Status](https://github.com/lahmatiy/clap/actions/workflows/build.yml/badge.svg)](https://github.com/lahmatiy/clap/actions/workflows/build.yml)
 [![Coverage Status](https://coveralls.io/repos/github/lahmatiy/clap/badge.svg?branch=master)](https://coveralls.io/github/lahmatiy/clap?branch=master)
 
 # Clap.js