Skip to content

Commit

Permalink
Merge pull request #3430 from dependabot/jurre/clean-up-ci-workflow
Browse files Browse the repository at this point in the history
CI: Simplify workflow by moving suite specific tests into test script
  • Loading branch information
jurre authored Apr 1, 2021
2 parents 1610f91 + 7c84fdb commit 5ec0348
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,6 @@ jobs:
run: |
docker push "$CORE_CI_IMAGE:latest"
docker push "$CORE_CI_IMAGE:ci--$BRANCH_REF"
- name: Run Python flake8 linting
if: matrix.suite.name == 'python'
run: |
docker run --rm "$CORE_CI_IMAGE" bash -c "pyenv exec flake8 python/helpers/. --count --exclude=./.*,./python/spec/fixtures --show-source --statistics"
- name: Run js linting and tests
if: matrix.suite.name == 'npm_and_yarn'
run: |
docker run --rm "$CORE_CI_IMAGE" bash -c "cd /opt/npm_and_yarn && npm run lint"
docker run --rm "$CORE_CI_IMAGE" bash -c "cd /opt/npm_and_yarn && npm test"
- name: Run bundler v1 native helper specs
if: matrix.suite.name == 'bundler1'
run: |
docker run --rm "$CORE_CI_IMAGE" bash -c \
"cd /home/dependabot/dependabot-core/bundler/helpers/v1 && BUNDLER_VERSION=1 bundle install && BUNDLER_VERSION=1 bundle exec rspec spec"
- name: Run bundler v2 native helper specs
if: matrix.suite.name == 'bundler2'
run: |
docker run --rm "$CORE_CI_IMAGE" bash -c \
"cd /home/dependabot/dependabot-core/bundler/helpers/v2 && BUNDLER_VERSION=2 bundle install && BUNDLER_VERSION=2 bundle exec rspec spec"
- name: Run ${{ matrix.suite.name }} tests
run: |
docker run --env "CI=true" --env "DEPENDABOT_TEST_ACCESS_TOKEN=$DEPENDABOT_TEST_ACCESS_TOKEN" --env "SUITE_NAME=${{ matrix.suite.name }}" --rm "$CORE_CI_IMAGE" bash -c \
Expand Down
14 changes: 14 additions & 0 deletions bundler/script/ci-test
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@
bundle install
bundle exec rubocop .
bundle exec rspec spec

if [ "$SUITE_NAME" == "bundler1" ]; then
cd helpers/v1 && \
BUNDLER_VERSION=1 bundle install && \
BUNDLER_VERSION=1 bundle exec rspec spec &&\
cd -
fi

if [ "$SUITE_NAME" == "bundler2" ]; then
cd helpers/v2 && \
BUNDLER_VERSION=2 bundle install && \
BUNDLER_VERSION=2 bundle exec rspec spec &&\
cd -
fi
3 changes: 3 additions & 0 deletions npm_and_yarn/script/ci-test
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
bundle install
bundle exec rubocop .
bundle exec rspec spec

cd /opt/npm_and_yarn && npm run lint && cd -
cd /opt/npm_and_yarn && npm test && cd -
1 change: 1 addition & 0 deletions python/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

bundle install
pyenv exec flake8 helpers/. --count --exclude=./.*,./python/spec/fixtures --show-source --statistics
bundle exec rubocop .
bundle exec rspec spec

0 comments on commit 5ec0348

Please sign in to comment.