Skip to content

Commit a9692b0

Browse files
authored
ci: add package manager install checks (#59)
* ci: add package manager install checks * remove build.zip file extension
1 parent 0a0445f commit a9692b0

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI Build install
2+
# This workflow creates a tarball from repo sources
3+
# It then checks that each of the following package managers is able to install:
4+
# - npm
5+
# - Yarn v1 Classic
6+
# - Yarn (Modern)
7+
# - pnpm
8+
# - bun
9+
on:
10+
push:
11+
branches:
12+
- main
13+
pull_request:
14+
branches:
15+
- main
16+
workflow_dispatch:
17+
jobs:
18+
npm-build:
19+
name: Build tarball
20+
runs-on: ubuntu-latest
21+
outputs:
22+
version: ${{ steps.get_version.outputs.version }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- run: npm pack
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: build
29+
path: eslint-css-*.tgz
30+
retention-days: 1
31+
- name: Get version
32+
id: get_version
33+
run: echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"
34+
npm-install:
35+
name: Install with npm
36+
needs: npm-build
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/download-artifact@v4
40+
with:
41+
name: build
42+
- name: npm install
43+
run: |
44+
npm install ./eslint-css-${{ needs.npm-build.outputs.version }}.tgz -D
45+
yarn-v1-install:
46+
name: Install with Yarn v1
47+
if: false # disable due to https://github.com/eslint/css/issues/58
48+
needs: npm-build
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
name: build
54+
- name: yarn add
55+
run: |
56+
yarn add ./eslint-css-${{ needs.npm-build.outputs.version }}.tgz -D
57+
yarn-install:
58+
name: Install with Yarn
59+
needs: npm-build
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/download-artifact@v4
63+
with:
64+
name: build
65+
- name: Setup Node.js
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version: 22.14.0 # minimum for Corepack
69+
- name: yarn add
70+
run: |
71+
corepack enable yarn
72+
corepack use yarn@latest
73+
yarn init -p
74+
yarn add ./eslint-css-${{ needs.npm-build.outputs.version }}.tgz -D
75+
env:
76+
YARN_ENABLE_IMMUTABLE_INSTALLS: 0 # Allow installs to modify lockfile
77+
pnpm-install:
78+
name: Install with pnpm
79+
if: false # disable due to https://github.com/eslint/css/issues/56
80+
needs: npm-build
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/download-artifact@v4
84+
with:
85+
name: build
86+
- name: Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version: 22.14.0 # minimum for Corepack
90+
- name: pnpm add
91+
run: |
92+
corepack enable pnpm
93+
corepack use pnpm@latest
94+
cat > .npmrc <<EOT
95+
auto-install-peers=true
96+
node-linker=hoisted
97+
EOT
98+
pnpm add ./eslint-css-${{ needs.npm-build.outputs.version }}.tgz -D
99+
bun-install:
100+
name: Install with bun
101+
needs: npm-build
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/download-artifact@v4
105+
with:
106+
name: build
107+
- name: setup bun
108+
uses: oven-sh/setup-bun@v2
109+
- name: bun install
110+
run: |
111+
bun install ./eslint-css-${{ needs.npm-build.outputs.version }}.tgz -D

0 commit comments

Comments
 (0)