Skip to content

Commit

Permalink
Travis CI → GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Nov 20, 2020
1 parent 29c4994 commit 75d0f7e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

14 changes: 13 additions & 1 deletion bin/ci
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`
: ""
}
}
Expand Down

0 comments on commit 75d0f7e

Please sign in to comment.