Skip to content

Commit

Permalink
chore: Move tests from Travis to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiomkar committed Jan 10, 2020
1 parent 1112b8d commit 8530e0c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 29 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: MDC Build Test

on:
pull_request:
paths:
- '**.ts'
- '**.scss'
- '**.js'
- '**/package.json'

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
- run: npm install
- run: npm run dist
11 changes: 5 additions & 6 deletions .github/workflows/test.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: MDC Test
name: MDC Lint

on:
pull_request:
push:
branches:
- master
- develop
- feature/**
paths:
- '**.ts'
- '**.scss'
- '**.js'

jobs:
lint:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/site-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: MDC Site Generator Test

on:
pull_request:
paths:
- 'docs/**'
- '**.md'
- '**.png'
- '**.jpg'
- '**.jpeg'
- '**.gif'
- '**.svg'

jobs:
site-generator-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
- run: npm install
- run: npm run test:site
13 changes: 0 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ after_script:

matrix:
include:

- node_js: 10
env:
- TEST_SUITE=build
script:
- if has_testable_files; then npm run dist; else log_untestable_files; fi

- node_js: 10
env:
- TEST_SUITE=unit
Expand All @@ -48,12 +41,6 @@ matrix:
after_success:
- codecov

- node_js: 8
env:
- TEST_SUITE=site-generator
script:
- if has_testable_files; then npm run test:site; else log_untestable_files; fi

- node_js: 10
env:
- TEST_SUITE=screenshot
Expand Down
10 changes: 0 additions & 10 deletions scripts/travis-env-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ if [[ "$TEST_SUITE" == 'unit' ]]; then
check_for_testable_files '^karma\.conf\.js$' '^packages/.+\.(js|ts)$' '^test/unit/.+\.(js|ts)$' '^testing/.+\.ts'
fi

if [[ "$TEST_SUITE" == 'build' ]]; then
# Only run build if package JS/Sass files changed
check_for_testable_files '^packages/.+\.(js|ts|css|scss)$'
fi

if [[ "$TEST_SUITE" == 'site-generator' ]]; then
# Only run site-generator test if docs, Markdown, or image files changed
check_for_testable_files '^docs/' '\.md$' '\.(png|jpg|jpeg|gif|svg)$'
fi

if [[ "$TEST_SUITE" == 'screenshot' ]]; then
# Only run screenshot tests if the following change:
# - package (non-unit test) JS/Sass files
Expand Down

0 comments on commit 8530e0c

Please sign in to comment.