diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..128adda --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,63 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: npm install + + - name: Run build + run: npm run build + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: npm install + + - name: Run linter + run: npm run lint + + test: + name: Test on Node.js ${{ matrix.node }} + runs-on: ubuntu-latest + strategy: + matrix: + node: [6, 8, 10, 12, 14, 16, 18, 20, 22] + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm run unit diff --git a/.npmignore b/.npmignore index 28c5fe2..558ab66 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,3 @@ -.travis.yml +.github/ bench/ test/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b2a4fe6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false -os: - - linux -language: node_js -node_js: - - lts/* - - '6' - - '8' - - '10' - - '12' - - '14' -env: - matrix: - - TEST_SUITE=unit -matrix: - include: - - os: linux - node_js: lts/* - env: TEST_SUITE=lint -script: npm run $TEST_SUITE diff --git a/README.md b/README.md index 8026e0e..a677b99 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ `base64-js` does basic base64 encoding/decoding in pure JS. -[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) +[![CI](https://github.com/feross/base64-js/actions/workflows/main.yml/badge.svg)](https://github.com/feross/base64-js/actions/workflows/main.yml) Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.