Skip to content

Commit 3c7fc69

Browse files
authored
Workflow improvements (#9609)
* remove unnecessary download links GitHub already shows them in a table right below it. * detach `npm run style` from `npm run test` * decouple lint from test in workflows Which means that we don't need to do the crazy linking in certain workflows. * hoist the `CI` environment variable * create dedicated `lint` job The `lint` tests will run against source files and should not be dependant on a specific node version. Instead of running the `npm run style` on every node version we use, we can and should only run it once. * remove `prettier-plugin-tailwindcss` As long as we use older versions of node/npm where we can't have ourselves as a dependency, it is a bit of a mess to maintain properly sorted html in tests. Let's remove it for now until we have a better solution!
1 parent 40f6b4f commit 3c7fc69

File tree

7 files changed

+46
-64
lines changed

7 files changed

+46
-64
lines changed

.github/workflows/integration-tests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
permissions:
1010
contents: read
1111

12+
env:
13+
CI: true
14+
1215
jobs:
1316
test:
1417
runs-on: ubuntu-latest
@@ -47,8 +50,6 @@ jobs:
4750
- name: Install dependencies
4851
# if: steps.cache-tailwindcss.outputs.cache-hit != 'true'
4952
run: npm install
50-
env:
51-
CI: true
5253

5354
- name: Build Tailwind CSS
5455
run: npm run prepublishOnly
@@ -65,8 +66,6 @@ jobs:
6566
- name: Install shared dependencies
6667
if: steps.cache-integrations.outputs.cache-hit != 'true'
6768
run: npm run install:integrations
68-
env:
69-
CI: true
7069

7170
- name: Test ${{ matrix.integration }}
7271
run: npm test --prefix ./integrations/${{ matrix.integration }}

.github/workflows/nodejs.yml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
permissions:
1313
contents: read
1414

15+
env:
16+
CI: true
17+
1518
jobs:
1619
build:
1720
runs-on: ubuntu-latest
@@ -40,17 +43,40 @@ jobs:
4043
- name: Install dependencies
4144
# if: steps.cache.outputs.cache-hit != 'true'
4245
run: npm install
43-
env:
44-
CI: true
4546

4647
- name: Build Tailwind CSS
4748
run: npm run swcify
48-
env:
49-
CI: true
5049

5150
- name: Test
52-
run: |
53-
ln -nfs `pwd` node_modules/tailwindcss # So that Prettier can use the local version
54-
npm test
55-
env:
56-
CI: true
51+
run: npm test
52+
53+
lint:
54+
runs-on: ubuntu-latest
55+
56+
strategy:
57+
matrix:
58+
node-version: [16]
59+
60+
steps:
61+
- uses: actions/checkout@v3
62+
- name: Use Node.js ${{ matrix.node-version }}
63+
uses: actions/setup-node@v3
64+
with:
65+
node-version: ${{ matrix.node-version }}
66+
# cache: 'npm'
67+
#
68+
# - name: Use cached node_modules
69+
# id: cache
70+
# uses: actions/cache@v3
71+
# with:
72+
# path: node_modules
73+
# key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
74+
# restore-keys: |
75+
# nodeModules-
76+
77+
- name: Install dependencies
78+
# if: steps.cache.outputs.cache-hit != 'true'
79+
run: npm install
80+
81+
- name: Lint
82+
run: npm run style

.github/workflows/prepare-release.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ jobs:
6868
tag_name: ${{ env.TAG_NAME }}
6969
body: |
7070
${{ env.RELEASE_NOTES }}
71-
72-
* [Linux (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-linux-arm64)
73-
* [Linux (armv7)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-linux-armv7)
74-
* [Linux (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-linux-x64)
75-
* [macOS (arm64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-macos-arm64)
76-
* [macOS (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-macos-x64)
77-
* [Windows (x64)](https://github.com/tailwindlabs/tailwindcss/releases/download/${{ env.TAG_NAME }}/tailwindcss-windows-x64.exe)
7871
files: |
7972
standalone-cli/dist/tailwindcss-linux-arm64
8073
standalone-cli/dist/tailwindcss-linux-armv7

.github/workflows/release-insiders.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
permissions:
88
contents: read
99

10+
env:
11+
CI: true
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
@@ -37,26 +40,12 @@ jobs:
3740
- name: Install dependencies
3841
# if: steps.cache.outputs.cache-hit != 'true'
3942
run: npm install
40-
env:
41-
CI: true
4243

43-
- name: Link and build Tailwind CSS
44-
run: |
45-
npm run swcify
46-
ln -nfs `pwd` node_modules/tailwindcss
47-
env:
48-
CI: true
44+
- name: Build Tailwind CSS
45+
run: npm run swcify
4946

5047
- name: Test
5148
run: npm test
52-
env:
53-
CI: true
54-
55-
- name: Unlink Tailwind CSS (for prettier)
56-
run: |
57-
unlink node_modules/tailwindcss
58-
env:
59-
CI: true
6049

6150
- name: Resolve version
6251
id: vars
@@ -69,7 +58,6 @@ jobs:
6958
- name: Publish
7059
run: npm publish --tag insiders
7160
env:
72-
CI: true
7361
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7462

7563
- name: Trigger Tailwind Play update

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
permissions:
88
contents: read
99

10+
env:
11+
CI: true
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
@@ -37,13 +40,9 @@ jobs:
3740
- name: Install dependencies
3841
# if: steps.cache.outputs.cache-hit != 'true'
3942
run: npm install
40-
env:
41-
CI: true
4243

4344
- name: Test
4445
run: npm test
45-
env:
46-
CI: true
4746

4847
- name: Calculate environment variables
4948
run: |
@@ -53,7 +52,6 @@ jobs:
5352
- name: Publish
5453
run: npm publish --tag ${{ env.RELEASE_CHANNEL }}
5554
env:
56-
CI: true
5755
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5856

5957
- name: Trigger Tailwind Play update

package-lock.json

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"test": "jest",
2424
"test:integrations": "npm run test --prefix ./integrations",
2525
"install:integrations": "node scripts/install-integrations.js",
26-
"posttest": "npm run style",
2726
"generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
2827
"generate:types": "node -r @swc/register scripts/generate-types.js",
2928
"generate": "npm run generate:plugin-list && npm run generate:types",
@@ -57,7 +56,6 @@
5756
"jest": "^28.1.3",
5857
"jest-diff": "^28.1.3",
5958
"prettier": "^2.7.1",
60-
"prettier-plugin-tailwindcss": "^0.1.13",
6159
"rimraf": "^3.0.0",
6260
"source-map-js": "^1.0.2"
6361
},

0 commit comments

Comments
 (0)