Skip to content

Commit d2f63b9

Browse files
committed
Use Flarum's build action
1 parent 6bf8acb commit d2f63b9

File tree

1 file changed

+7
-75
lines changed

1 file changed

+7
-75
lines changed

.github/workflows/smoketest.yml

Lines changed: 7 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,12 @@
1-
# This CI workflow was adapted from flarum/core
2-
# and davwheat/let-me-really-google-that-for-you
3-
41
name: Smoketest
52

63
on:
74
push:
8-
branches:
9-
- 'main'
105

116
jobs:
127
install:
138
runs-on: ubuntu-latest
14-
name: Prepare repo
15-
16-
strategy:
17-
matrix:
18-
node-version: [14.x]
19-
20-
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v2
23-
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v1
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
29-
- name: Enter JS directory
30-
run: cd js
31-
32-
- name: Get yarn cache directory path
33-
id: yarn-cache-dir-path
34-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
35-
36-
- name: Restore dependencies cache
37-
uses: actions/cache@v2
38-
id: yarnCache
39-
with:
40-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
41-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42-
restore-keys: |
43-
${{ runner.os }}-yarn-
44-
45-
- name: Restore node_modules
46-
uses: actions/cache@v2
47-
id: moduleCache
48-
with:
49-
path: ./js/node_modules
50-
key: ${{ runner.os }}-node-modules-${{ github.sha }}-${{ hashFiles('**/yarn.lock') }}
51-
restore-keys: |
52-
${{ runner.os }}-node-modules-${{ github.sha }}-
53-
${{ runner.os }}-node-modules-
54-
55-
- name: Install dependencies on cache miss
56-
run: cd js && yarn install --frozen-lockfile
57-
if: steps.yarn-cache.outputs.cache-hit != 'true'
58-
59-
- name: Install project dependencies from cache
60-
run: cd js && yarn --prefer-offline --frozen-lockfile
61-
if: steps.yarn-cache.outputs.cache-hit == 'true'
62-
63-
formatting:
64-
runs-on: ubuntu-latest
65-
needs: [install]
66-
name: Verify formatting
9+
name: Format and build
6710

6811
strategy:
6912
matrix:
@@ -74,7 +17,7 @@ jobs:
7417
uses: actions/checkout@v2
7518

7619
- name: Use Node.js ${{ matrix.node-version }}
77-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v2
7821
with:
7922
node-version: ${{ matrix.node-version }}
8023

@@ -92,19 +35,8 @@ jobs:
9235
- name: Verify formatting
9336
run: composer run format:check
9437

95-
build:
96-
name: Build JS bundle
97-
runs-on: ubuntu-latest
98-
needs: [formatting]
99-
100-
strategy:
101-
matrix:
102-
node-version: [14.x]
103-
104-
steps:
105-
- name: Checkout code
106-
uses: actions/checkout@v2
107-
108-
- uses: davwheat/[email protected]
109-
env:
110-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
- uses: flarum/action-build@2
39+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
package_manager: yarn

0 commit comments

Comments
 (0)