-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch automated tests to Github Actions (#5111)
- Loading branch information
1 parent
726d0d8
commit d4176ca
Showing
5 changed files
with
154 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Merge to release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
inputs: | ||
commit_message: | ||
description: Commit message | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
if: github.event_name == 'push' | ||
- uses: actions/checkout@v2 | ||
if: github.event_name == 'workflow_dispatch' | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Checkout release branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'v1.0.1' | ||
path: './release' | ||
|
||
- name: Check for relevant changes | ||
if: github.event_name == 'push' | ||
uses: dorny/paths-filter@v2 | ||
id: release | ||
with: | ||
list-files: shell | ||
filters: | | ||
updated: | ||
- added|modified: [ '*.csl', '*.xml' ] | ||
deleted: | ||
- deleted: [ '*.csl', '*.xml' ] | ||
- name: Changed files | ||
if: github.event_name == 'push' | ||
run: | | ||
echo updated: ${{ steps.release.outputs.updated_files }} | ||
echo deleted: ${{ steps.release.outputs.deleted_files }} | ||
- name: Set up Ruby | ||
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true')) | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.1 | ||
- name: but use cache to speed that up | ||
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true')) | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Bundle install | ||
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true')) | ||
run: | | ||
bundle config path vendor/bundle | ||
bundle update sheldon --jobs 4 --retry 3 | ||
- name: Populate new branch | ||
run: bundle exec sheldon --token=$GITHUB_TOKEN --verbose --populate release | ||
if: github.event_name == 'workflow_dispatch' | ||
|
||
- name: update the timestamps and add the changes | ||
run: bundle exec sheldon --token=$GITHUB_TOKEN --verbose --release release ${{ steps.release.outputs.updated_files }} | ||
if: github.event_name == 'push' && steps.release.outputs.updated == 'true' | ||
|
||
- name: delete deleted files | ||
run: cd release && git rm ${{ steps.release.outputs.deleted_files }} | ||
if: github.event_name == 'push' && steps.release.outputs.deleted == 'true' | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
repository: 'release' | ||
commit_message: Releasing ${{ steps.release.outputs.updated_files }} ${{ steps.release.outputs.deleted_files }} | ||
if: github.event_name == 'push' && (steps.release.outputs.updated == 'true' || steps.release.outputs.deleted == 'true') | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
repository: 'release' | ||
commit_message: ${{ github.event.inputs.commit_message }} | ||
if: github.event_name == 'workflow_dispatch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Pull request feedback | ||
|
||
on: | ||
pull_request_target: | ||
types: [ opened, synchronize ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Check for relevant changes | ||
uses: dorny/paths-filter@v2 | ||
id: sheldon | ||
with: | ||
list-files: shell | ||
filters: | | ||
changed: | ||
- '*.csl' | ||
- name: Changed files | ||
run: | | ||
echo changed: ${{ steps.sheldon.outputs.changed_files }} | ||
- name: Set up Ruby | ||
if: steps.sheldon.outputs.changed == 'true' | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.1 | ||
- name: but use cache to speed that up | ||
if: steps.sheldon.outputs.changed == 'true' | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Bundle install | ||
if: steps.sheldon.outputs.changed == 'true' | ||
run: | | ||
bundle config path vendor/bundle | ||
bundle update sheldon --jobs 4 --retry 3 | ||
- name: Apply the PR | ||
if: steps.sheldon.outputs.changed == 'true' | ||
run: bundle exec sheldon --token=$GITHUB_TOKEN --apply | ||
|
||
- name: Welcome to a new PR | ||
if: github.event.action == 'opened' && steps.sheldon.outputs.changed == 'true' | ||
run: bundle exec sheldon --token=$GITHUB_TOKEN --welcome | ||
|
||
- name: See if the styles work | ||
if: steps.sheldon.outputs.changed == 'true' | ||
run: bundle exec rake | ||
|
||
- name: report | ||
if: (failure() || success()) && steps.sheldon.outputs.changed == 'true' | ||
run: bundle exec sheldon --token=$GITHUB_TOKEN --report --verbose |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters