|
| 1 | +name: CI/CD |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + |
| 9 | +env: |
| 10 | + NODE_VERSION: 10 |
| 11 | + |
| 12 | +jobs: |
| 13 | + lint: |
| 14 | + name: Lint files |
| 15 | + runs-on: ubuntu-latest |
| 16 | + timeout-minutes: 7 |
| 17 | + steps: |
| 18 | + - name: Check out a copy of the repo |
| 19 | + uses: actions/checkout@v2 |
| 20 | + |
| 21 | + - name: Use Node.js ${{ env.NODE_VERSION }} |
| 22 | + uses: actions/setup-node@v2-beta |
| 23 | + with: |
| 24 | + node-version: ${{ env.NODE_VERSION }} |
| 25 | + |
| 26 | + - name: Get Yarn cache path |
| 27 | + id: yarn-cache-dir-path |
| 28 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 29 | + |
| 30 | + - name: Cache Yarn cache and node_modules |
| 31 | + id: cache-dependencies |
| 32 | + uses: actions/cache@v2 |
| 33 | + with: |
| 34 | + path: | |
| 35 | + ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 36 | + node_modules |
| 37 | + test-apps/new-addon/node_modules |
| 38 | + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }} |
| 39 | + restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}- |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + run: yarn install --frozen-lockfile |
| 43 | + if: steps.cache-dependencies.outputs.cache-hit != 'true' |
| 44 | + |
| 45 | + - name: Lint |
| 46 | + run: yarn lint |
| 47 | + |
| 48 | + |
| 49 | + test-addon-floating: |
| 50 | + name: Test addon (floating dependencies) |
| 51 | + runs-on: ubuntu-latest |
| 52 | + strategy: |
| 53 | + fail-fast: true |
| 54 | + matrix: |
| 55 | + script-name: |
| 56 | + - 'ember' |
| 57 | + - 'node' |
| 58 | + - 'test-apps' |
| 59 | + timeout-minutes: 7 |
| 60 | + steps: |
| 61 | + - name: Check out a copy of the repo |
| 62 | + uses: actions/checkout@v2 |
| 63 | + |
| 64 | + - name: Use Node.js ${{ env.NODE_VERSION }} |
| 65 | + uses: actions/setup-node@v2-beta |
| 66 | + with: |
| 67 | + node-version: ${{ env.NODE_VERSION }} |
| 68 | + |
| 69 | + - name: Install dependencies |
| 70 | + run: yarn install --no-lockfile --non-interactive |
| 71 | + |
| 72 | + - name: Test |
| 73 | + run: yarn test:${{ matrix.script-name }} |
| 74 | + |
| 75 | + |
| 76 | + test-addon-locked: |
| 77 | + name: Test addon (locked dependencies) |
| 78 | + runs-on: ubuntu-latest |
| 79 | + strategy: |
| 80 | + fail-fast: true |
| 81 | + matrix: |
| 82 | + script-name: |
| 83 | + - 'ember' |
| 84 | + - 'node' |
| 85 | + - 'test-apps' |
| 86 | + timeout-minutes: 7 |
| 87 | + steps: |
| 88 | + - name: Check out a copy of the repo |
| 89 | + uses: actions/checkout@v2 |
| 90 | + |
| 91 | + - name: Use Node.js ${{ env.NODE_VERSION }} |
| 92 | + uses: actions/setup-node@v2-beta |
| 93 | + with: |
| 94 | + node-version: ${{ env.NODE_VERSION }} |
| 95 | + |
| 96 | + - name: Get Yarn cache path |
| 97 | + id: yarn-cache-dir-path |
| 98 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 99 | + |
| 100 | + - name: Cache Yarn cache and node_modules |
| 101 | + id: cache-dependencies |
| 102 | + uses: actions/cache@v2 |
| 103 | + with: |
| 104 | + path: | |
| 105 | + ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 106 | + node_modules |
| 107 | + test-apps/new-addon/node_modules |
| 108 | + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }} |
| 109 | + restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}- |
| 110 | + |
| 111 | + - name: Install dependencies |
| 112 | + run: yarn install --frozen-lockfile |
| 113 | + if: steps.cache-dependencies.outputs.cache-hit != 'true' |
| 114 | + |
| 115 | + - name: Test |
| 116 | + run: yarn test:${{ matrix.script-name }} |
| 117 | + |
| 118 | + |
| 119 | + test-compatibility: |
| 120 | + name: Test compatibility |
| 121 | + runs-on: ubuntu-latest |
| 122 | + strategy: |
| 123 | + fail-fast: true |
| 124 | + matrix: |
| 125 | + scenario: |
| 126 | + - 'ember-lts-3.16' |
| 127 | + - 'ember-lts-3.20' |
| 128 | + - 'ember-release' |
| 129 | + - 'ember-beta' |
| 130 | + - 'ember-canary' |
| 131 | + - 'ember-default-with-jquery' |
| 132 | + - 'ember-classic' |
| 133 | + - 'ember-concurrency-1.x' |
| 134 | + - 'ember-concurrency-2.x' |
| 135 | + timeout-minutes: 7 |
| 136 | + steps: |
| 137 | + - name: Check out a copy of the repo |
| 138 | + uses: actions/checkout@v2 |
| 139 | + |
| 140 | + - name: Use Node.js ${{ env.NODE_VERSION }} |
| 141 | + uses: actions/setup-node@v2-beta |
| 142 | + with: |
| 143 | + node-version: ${{ env.NODE_VERSION }} |
| 144 | + |
| 145 | + - name: Get Yarn cache path |
| 146 | + id: yarn-cache-dir-path |
| 147 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 148 | + |
| 149 | + - name: Cache Yarn cache and node_modules |
| 150 | + id: cache-dependencies |
| 151 | + uses: actions/cache@v2 |
| 152 | + with: |
| 153 | + path: | |
| 154 | + ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 155 | + node_modules |
| 156 | + test-apps/new-addon/node_modules |
| 157 | + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ matrix.scenario }}-${{ hashFiles('**/yarn.lock') }} |
| 158 | + restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ matrix.scenario }}- |
| 159 | + |
| 160 | + - name: Install dependencies |
| 161 | + run: yarn install --frozen-lockfile |
| 162 | + if: steps.cache-dependencies.outputs.cache-hit != 'true' |
| 163 | + |
| 164 | + - name: Test |
| 165 | + run: yarn test:ember-compatibility ${{ matrix.scenario }} |
| 166 | + |
| 167 | + |
| 168 | + deploy-app: |
| 169 | + name: Deploy app |
| 170 | + needs: [lint, test-addon-floating, test-addon-locked, test-compatibility] |
| 171 | + runs-on: ubuntu-latest |
| 172 | + timeout-minutes: 7 |
| 173 | + # Only run on pushes to the default branch |
| 174 | + if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 175 | + steps: |
| 176 | + - name: Check out a copy of the repo |
| 177 | + uses: actions/checkout@v2 |
| 178 | + |
| 179 | + - name: Set up Git user |
| 180 | + run: | |
| 181 | + # Set up a Git user for committing |
| 182 | + git config --global user.name "GitHub Actions" |
| 183 | + git config --global user.email "actions@users.noreply.github.com" |
| 184 | +
|
| 185 | + # Copy the Git Auth from the local config |
| 186 | + git config --global "http.https://github.com/.extraheader" \ |
| 187 | + "$(git config --local --get http.https://github.com/.extraheader)" |
| 188 | +
|
| 189 | + - name: Use Node.js ${{ env.NODE_VERSION }} |
| 190 | + uses: actions/setup-node@v2-beta |
| 191 | + with: |
| 192 | + node-version: ${{ env.NODE_VERSION }} |
| 193 | + |
| 194 | + - name: Get Yarn cache path |
| 195 | + id: yarn-cache-dir-path |
| 196 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 197 | + |
| 198 | + - name: Cache Yarn cache and node_modules |
| 199 | + id: cache-dependencies |
| 200 | + uses: actions/cache@v2 |
| 201 | + with: |
| 202 | + path: | |
| 203 | + ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 204 | + node_modules |
| 205 | + test-apps/new-addon/node_modules |
| 206 | + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }} |
| 207 | + restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}- |
| 208 | + |
| 209 | + - name: Install dependencies |
| 210 | + run: yarn install --frozen-lockfile |
| 211 | + if: steps.cache-dependencies.outputs.cache-hit != 'true' |
| 212 | + |
| 213 | + - name: Deploy |
| 214 | + run: yarn deploy |
0 commit comments