diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b0ff7cf5b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + name: Browser tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - uses: actions/setup-node@v2-beta + with: + node-version: 11 + - uses: actions/cache@v2 + with: + path: test/node_modules + key: ${{ runner.os }}-${{ hashFiles('test/yarn.lock') }} + + - run: cd test && yarn install + - run: bin/ci diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 61a7b6bf4..000000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -dist: xenial -sudo: false -language: node_js -node_js: 11 -cache: - - bundler - - yarn -install: - - bundle install - - cd test && yarn install && cd - -script: - - bin/ci diff --git a/bin/ci b/bin/ci index 11411f94d..1c199b43d 100755 --- a/bin/ci +++ b/bin/ci @@ -1,7 +1,19 @@ #!/usr/bin/env bash set -e -if [ "$TRAVIS_REPO_SLUG" == "basecamp/trix" ] && [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then +if [ -n "$CI" ]; then + echo "GITHUB_WORKFLOW: $GITHUB_WORKFLOW" + echo "GITHUB_RUN_NUMBER: $GITHUB_RUN_NUMBER" + echo "GITHUB_RUN_ID: $GITHUB_RUN_ID" + echo "GITHUB_ACTOR: $GITHUB_ACTOR" + echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" + echo "GITHUB_SHA: $GITHUB_SHA" + echo "GITHUB_REF: $GITHUB_REF" + echo "GITHUB_HEAD_REF: $GITHUB_HEAD_REF" + echo "GITHUB_BASE_REF: $GITHUB_BASE_REF" +fi + +if [ -n "$CI" ] && [ "$GITHUB_REF" == "refs/heads/master" ] && [ -z "$GITHUB_HEAD_REF" ]; then $(base64 --decode <<< ZXhwb3J0IFNBVUNFX1VTRVJOQU1FPWJhc2VjYW1wX3RyaXgK) $(base64 --decode <<< ZXhwb3J0IFNBVUNFX0FDQ0VTU19LRVk9MjY3OGE4NzMtNzJmNC00NzU2LTkzYjUtZjFhOGUyZTc3ODIxCg==) else diff --git a/test/karma.conf.js b/test/karma.conf.js index 15ead755a..89201947a 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -114,9 +114,9 @@ if (process.env.CI) { } function buildId() { - const { TRAVIS_BUILD_NUMBER, TRAVIS_BUILD_ID } = process.env - return TRAVIS_BUILD_NUMBER && TRAVIS_BUILD_ID - ? `TRAVIS #${TRAVIS_BUILD_NUMBER} (${TRAVIS_BUILD_ID})` + const { GITHUB_WORKFLOW, GITHUB_RUN_NUMBER, GITHUB_RUN_ID } = process.env + return GITHUB_WORKFLOW && GITHUB_RUN_NUMBER && GITHUB_RUN_ID + ? `${GITHUB_WORKFLOW} #${GITHUB_RUN_NUMBER} (${GITHUB_RUN_ID})` : "" } }