diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml new file mode 100644 index 0000000..d5c2a8f --- /dev/null +++ b/.github/workflows/master.yaml @@ -0,0 +1,39 @@ +name: Test, build and publish + +on: + push: + branches: + - master + +env: + CI: true +jobs: + test-build-publish: + name: Test and build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies + run: npm ci + - name: Test + run: npm run test:prod + - name: Build + run: npm run build + - name: Report coverage + run: npm run report-coverage + - name: Publish docs + run: npm run deploy-docs + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Publish package + run: npm run semantic-release + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + NPM_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..5c3083f --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,29 @@ +name: Test and build + +on: + push: + branches-ignore: + - master + +env: + CI: true +jobs: + test-and-build: + name: Test and build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies + run: npm ci + - name: Test + run: npm run test:prod + - name: Build + run: npm run build + - name: Report coverage + run: npm run report-coverage diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index abc879a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js -cache: - directories: - - ~/.npm -notifications: - email: false -node_js: - - '10' - - '11' - - '8' -script: - - npm run test:prod && npm run build -after_success: - - npm run travis-deploy-once "npm run report-coverage" - - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run travis-deploy-once "npm run deploy-docs"; fi - - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run travis-deploy-once "npm run semantic-release"; fi -branches: - except: - - /^v\d+\.\d+\.\d+$/