Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from CrowdStrike/add-ember-cli-update-to-ci-and…
Browse files Browse the repository at this point in the history
…-use-auto-release-blueprint

Apply ember-addon-automated-ci blueprint, add ember-cli-update GH Action
  • Loading branch information
NullVoxPopuli authored Mar 16, 2021
2 parents 6c83809 + cbc96c3 commit 5ede2c6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 26 deletions.
58 changes: 34 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
name: CI

# based on:
# - https://github.com/NullVoxPopuli/eslint-plugin-decorator-position/blob/master/.github/workflows/lint.yml
# - https://github.com/NullVoxPopuli/ember-autostash-modifier/blob/master/.github/workflows/ci.yml
# - https://github.com/emberjs/ember-test-helpers/blob/master/.github/workflows/ci-build.yml
# - https://github.com/NullVoxPopuli/ember-jsqr/blob/master/.github/workflows/tests.yml
on:
pull_request:
push:
# filtering branches here prevents duplicate builds from pull_request and push
branches:
- main
- master
schedule:
- cron: '0 3 * * 0' # every Sunday at 3am
- cron: "0 3 * * 0" # every Sunday at 3am

env:
CI: true
Expand All @@ -26,18 +21,18 @@ jobs:
strategy:
matrix:
node:
- "12"
- "14"
- "12"
- "14"
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node }}

- run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile

- name: Test with ${{ matrix.node }}
run: yarn test
- name: Test with ${{ matrix.node }}
run: yarn ember test

floating-dependencies:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
Expand All @@ -47,8 +42,8 @@ jobs:
strategy:
matrix:
node:
- "12"
- "14"
- "12"
- "14"

steps:
- uses: actions/checkout@v2
Expand All @@ -59,12 +54,12 @@ jobs:
- run: yarn install --no-lockfile

- name: Test with Node ${{ matrix.node }}
run: yarn test
run: yarn ember test

try-scenarios:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: "Compatibility"
timeout-minutes: 5
timeout-minutes: 7
runs-on: ubuntu-latest
needs: tests

Expand Down Expand Up @@ -92,12 +87,27 @@ jobs:
- name: test
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup

ember-cli-update:
if: github.event_name == 'pull_request' && github.event.pusher.name == 'renovate-bot'
runs-on: ubuntu-latest
needs: [tests, try-scenarios, floating-dependencies]

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GitHubToken }}
- uses: actions/setup-node@v2
- uses: kellyselden/ember-cli-update-action@v2
with:
autofix_command: yarn lint:fix
ignore_to: true

publish:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [tests, floating-dependencies, try-scenarios]
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
needs: [tests, try-scenarios, floating-dependencies]

steps:
- uses: actions/checkout@v2
Expand All @@ -107,7 +117,7 @@ jobs:
- run: yarn install

- name: Release
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
},
"release": {
"branches": [
"main"
"main",
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down Expand Up @@ -155,7 +156,7 @@
"configPath": "tests/dummy/config"
},
"volta": {
"node": "14.15.4",
"node": "12.20.2",
"yarn": "1.22.10"
}
}
9 changes: 9 additions & 0 deletions tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
]
}
]
},
{
"name": "ember-addon-automated-ci",
"version": "1.0.2",
"blueprints": [
{
"name": "ember-addon-automated-ci"
}
]
}
]
}

0 comments on commit 5ede2c6

Please sign in to comment.