Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI - Reuse organisation's workflows to lint, test, tag and publish #149

Merged
merged 3 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 9 additions & 192 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,200 +1,17 @@
# This file was autogenerated by create-github-actions-setup-for-ember-addons.
#
# You can upgrade the GitHub Actions workflow to the latest blueprints used
# by Create GitHub Actions setup for Ember Addons by running it again:
#
# - `yarn create github-actions-setup-for-ember-addons` if using yarn and
# - `npm init github-actions-setup-for-ember-addons` if using NPM.
#
# See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for
# details.
#
# The following lines contain the configuration used in the last run. Please do
# not change them. Doing so could break upgrade flow.
#
#$ browsers:
#$ - Chrome
#$ emberTryScenarios:
#$ - scenario: ember-lts-3.20
#$ - scenario: ember-lts-3.24
#$ - scenario: ember-release
#$ - scenario: ember-default-with-jquery
#$ - scenario: ember-classic
#$ nodeVersion: '12'
#$ packageManager: yarn
#
# GitHub Actions documentation:
# https://docs.github.com/en/actions

name: CI

on:
push:
branches:
- master
pull_request:
branches: master
pull_request: {}

env:
NODE_VERSION: '12'
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Lint
run: yarn lint


test:
name: Tests
runs-on: ${{ matrix.os }}
needs: lint

strategy:
matrix:
os: [ubuntu-latest]
browser: [Chrome]

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

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}


floating-dependencies:
name: Floating Dependencies
runs-on: ${{ matrix.os }}
needs: lint

strategy:
matrix:
os: [ubuntu-latest]
browser: [Chrome]

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

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
restore-keys: ${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}


try-scenarios:
name: Tests - ${{ matrix.ember-try-scenario }}
runs-on: ubuntu-latest
continue-on-error: true
needs: test

strategy:
fail-fast: true
matrix:
ember-try-scenario:
- ember-lts-3.20
- ember-lts-3.24
- ember-release
- ember-default-with-jquery
- ember-classic

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

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.node-version }}-

- name: Install Dependencies
run: yarn install --frozen-lockfile
if: steps.cache-dependencies.outputs.cache-hit != 'true'

- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
org:
uses: peopledoc/.github/.github/workflows/js--emberjs-addons-ci.yml@main
21 changes: 21 additions & 0 deletions .github/workflows/tag-release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# GitHub Actions documentation:
# https://docs.github.com/en/actions

name: Create new `git tag`, create new GitHub release and publish to NPM

on:
workflow_run:
workflows: CI
branches: master
types: completed

concurrency:
group: tag-release-publish-${{ github.ref }}
cancel-in-progress: true

jobs:
org:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: peopledoc/.github/.github/workflows/js--tag-release-publish.yml@main
secrets:
npm_automation_token: ${{ secrets.NPM_AUTOMATION_TOKEN }}
3 changes: 3 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ module.exports = async function () {
}),
},
npm: {
devDependencies: {
'ember-source': '~3.28.0',
},
ember: {
edition: 'classic',
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.4.2",
"@embroider/test-setup": "^0.43.5",
"@embroider/test-setup": "^0.47.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-cli": "~3.28.0",
"ember-cli": "~3.28.3",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.28.1",
"version": "3.28.3",
"blueprints": [
{
"name": "addon",
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,10 @@
resolve "^1.8.1"
semver "^7.3.2"

"@embroider/test-setup@^0.43.5":
version "0.43.5"
resolved "https://registry.yarnpkg.com/@embroider/test-setup/-/test-setup-0.43.5.tgz#79944cb50038802cc71d50aa0d5d7a0955ee6349"
integrity sha512-ke+5B0VR2343ZrOqV9Ok2LyA4m2q2ApM1Oy1RC8+3+OI5lDVg8UgZG9n/G2e77KPMFxnK3eVpXcPdLcdOxW6+w==
"@embroider/test-setup@^0.47.1":
version "0.47.1"
resolved "https://registry.yarnpkg.com/@embroider/test-setup/-/test-setup-0.47.1.tgz#01f6921612b292cb721b2102b3f40dbc89131039"
integrity sha512-PKV+UBixVmkrXo/9AdrtvBccmTbTG9zgJUA/hvoHIGaUISW5cepWyLU0dqW3gE2ECJjrvc4+KtBUMOC1rEZ2Ng==
dependencies:
lodash "^4.17.21"
resolve "^1.20.0"
Expand Down Expand Up @@ -4935,10 +4935,10 @@ ember-cli-version-checker@^5.1.1, ember-cli-version-checker@^5.1.2:
semver "^7.3.4"
silent-error "^1.1.1"

ember-cli@~3.28.0:
version "3.28.1"
resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.28.1.tgz#ba32fa6844ac3059bfe9fab355c6f8386dc81fed"
integrity sha512-1SgI4RWJor4yyQIZJvz1egPTYeNUwO5cm4YFXfozU1e5iKcIHM8M2UrGCf3GSGyaFptIxMaDBD3o7GJBnrAb1g==
ember-cli@~3.28.3:
version "3.28.3"
resolved "https://registry.yarnpkg.com/ember-cli/-/ember-cli-3.28.3.tgz#3384c3fb018b58111e30efed15a2f6a9b66b84c3"
integrity sha512-DddAQAddbyaOU4NAjTt8g+FoCCK/F00kbj9pcHO1lfAUpIUS9JPBoWxxZ3qO08mUNXi50pdQSPVVRWzN7mNz2g==
dependencies:
"@babel/core" "^7.13.8"
"@babel/plugin-transform-modules-amd" "^7.12.1"
Expand Down