Skip to content

Commit

Permalink
Infrastructure: Switch regression test to GitHub Actions (pull #1515)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni authored Sep 25, 2020
1 parent 7e78d9a commit 8f0b40b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 41 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run regression tests

on:
pull_request:
paths:
- ".github/workflows/regression.yml"
- "package*.json"
- "test/**"
- "examples/**"
- "!examples/landmarks/**"
push:
branches-ignore:
- master
paths:
- ".github/workflows/regression.yml"
- "package*.json"
- "test/**"
- "examples/**"
- "!examples/landmarks/**"

jobs:
deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
CI_NODE_INDEX: [0, 1, 2, 3, 4]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v1

- name: Install npm dependencies
run: npm ci

- name: Run Ava on changed files in PR
run: ./scripts/regression-tests.sh
if: github.event_name == 'pull_request'
env:
COMMIT_RANGE: "origin/${{ github.base_ref }}...${{ github.sha }}"
CI_NODE_TOTAL: 5
CI_NODE_INDEX: ${{ matrix.CI_NODE_INDEX }}
TEST_WAIT_TIME: 10000

- name: Run Ava for changed files from origin branch
run: ./scripts/regression-tests.sh
if: github.event_name == 'push'
env:
COMMIT_RANGE: "origin/master...${{ github.ref }}"
CI_NODE_TOTAL: 5
CI_NODE_INDEX: ${{ matrix.CI_NODE_INDEX }}
TEST_WAIT_TIME: 10000
29 changes: 0 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ git:

stages:
- Lint
- Test

jobs:
fast_finish: true
Expand All @@ -30,31 +29,3 @@ jobs:
name: Regression Tests Coverage Report
script: node test/util/report.js
env: ALLOW_FAILURE=true

- stage: Test
name: AVA Regression Tests
addons:
firefox: latest
script: scripts/regression-tests.sh
env:
- TEST_WAIT_TIME=1000
- CI_NODE_TOTAL=3
- CI_NODE_INDEX=0
- stage: Test
name: AVA Regression Tests
addons:
firefox: latest
script: scripts/regression-tests.sh
env:
- TEST_WAIT_TIME=1000
- CI_NODE_TOTAL=3
- CI_NODE_INDEX=1
- stage: Test
name: AVA Regression Tests
addons:
firefox: latest
script: scripts/regression-tests.sh
env:
- TEST_WAIT_TIME=1000
- CI_NODE_TOTAL=3
- CI_NODE_INDEX=2
12 changes: 0 additions & 12 deletions scripts/regression-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ if [[ "$CI" != "true" ]]
then
# When running this script locally, compare the current branch to master
COMMIT_RANGE="..master"

elif [[ "$TRAVIS_PULL_REQUEST" != "false" ]]
then
# If we are on a PR build, we can use TRAVIS_COMMIT_RANGE
COMMIT_RANGE=$TRAVIS_COMMIT_RANGE

else
# If we are on a branch build, and it has been force pushed, then TRAVIS_PULL_REQUEST will
# not contain useful information for the branch build.
COMMIT_RANGE="origin/master...$TRAVIS_BRANCH"
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin master
fi

AVACMD="npm run regression -- -t"
Expand Down

0 comments on commit 8f0b40b

Please sign in to comment.