Skip to content

Commit d0a83f5

Browse files
committed
ci: optimise workflow
1 parent 6440ee6 commit d0a83f5

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ on:
77
- feature*
88

99
env:
10-
# Caching
11-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
12-
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
13-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
14-
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16-
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
17-
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
18-
19-
# Other
2010
GIT_SUBMODULE_STRATEGY: recursive
2111
npm_config_cache: "${{ github.workspace }}/tmp/npm"
2212
npm_config_prefer_offline: "true"
@@ -27,7 +17,6 @@ jobs:
2717
runs-on: ubuntu-latest
2818
steps:
2919
- uses: actions/checkout@v4
30-
- uses: actions/setup-node@v4
3120
- name: Run linting
3221
run: |
3322
npm install
@@ -39,7 +28,6 @@ jobs:
3928
runs-on: ubuntu-latest
4029
steps:
4130
- uses: actions/checkout@v4
42-
- uses: actions/setup-node@v4
4331
- name: Run build
4432
run: |
4533
npm install
@@ -71,9 +59,8 @@ jobs:
7159
needs: check-matrix
7260
steps:
7361
- uses: actions/checkout@v4
74-
- uses: actions/setup-node@v4
7562
- name: Set artifact name
76-
run: echo "SLUG=$(echo ${{ matrix.shard }} | sed 's/[/.]/_/g')" >> $GITHUB_ENV
63+
run: echo "SLUG=$(echo ${{ matrix.shard }} | sed 's/[/.]/-/g')" >> $GITHUB_ENV
7764
- name: Run tests
7865
run: |
7966
npm install
@@ -99,7 +86,7 @@ jobs:
9986
path: tmp/coverage/
10087
merge-multiple: true
10188
- run: rm .npmrc
102-
- name: Merge Code Coverage
89+
- name: Merge coverage results
10390
run: npx nyc merge tmp/coverage/ tmp/coverage/cobertura-coverage.json
10491
- uses: actions/upload-artifact@v4
10592
with:
@@ -109,8 +96,6 @@ jobs:
10996
build-pull:
11097
name: "Build / Pull Request"
11198
runs-on: ubuntu-latest
112-
container:
113-
image: ghcr.io/matrixai/github-runner
11499
needs:
115100
- check-lint
116101
- check-build
@@ -122,7 +107,6 @@ jobs:
122107
env:
123108
GH_TOKEN: ${{ secrets.GH_TOKEN }}
124109
run: |
125-
git config --global --add safe.directory /__w/Polykey/Polykey
126110
gh pr create \
127111
--head staging \
128112
--base master \
@@ -138,8 +122,6 @@ jobs:
138122
build-prerelease:
139123
name: "Build / Pre-release"
140124
runs-on: ubuntu-latest
141-
container:
142-
image: ghcr.io/matrixai/github-runner
143125
needs:
144126
- check-lint
145127
- check-build
@@ -149,22 +131,18 @@ jobs:
149131
startsWith(github.ref, 'refs/tags/v') &&
150132
contains(github.ref, '-')
151133
steps:
152-
- run: entrypoint
153134
- uses: actions/checkout@v4
154135
- name: Run deployment
155136
run: |
156137
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
157138
echo 'Publishing library prerelease'
158-
nix develop .#ci --command bash -c $'
139+
npm install
159140
npm publish --tag prerelease --access public
160-
'
161141
rm -f ./.npmrc
162142
163143
integration-merge:
164144
name: "Integration / Merge"
165145
runs-on: ubuntu-latest
166-
container:
167-
image: ghcr.io/matrixai/github-runner
168146
concurrency:
169147
group: integration-merge
170148
cancel-in-progress: true
@@ -183,7 +161,6 @@ jobs:
183161
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
184162
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
185163
run: |
186-
git config --global --add safe.directory /__w/Polykey/Polykey
187164
printf "Pipeline Succeeded on $GITHUB_RUN_ID for $GITHUB_SHA\n\n$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
188165
| gh pr comment staging \
189166
--body-file - \
@@ -195,8 +172,6 @@ jobs:
195172
release-distribution:
196173
name: "Release / Distribution"
197174
runs-on: ubuntu-latest
198-
container:
199-
image: ghcr.io/matrixai/github-runner
200175
concurrency:
201176
group: release-distribution
202177
cancel-in-progress: false
@@ -206,14 +181,12 @@ jobs:
206181
startsWith(github.ref, 'refs/tags/v') &&
207182
!contains(github.ref, '-')
208183
steps:
209-
- run: entrypoint
210184
- uses: actions/checkout@v4
211185
- name: Publish release
212186
run: |
213187
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
214188
echo 'Publishing library'
215-
nix develop .#ci --command bash -c $'
189+
npm install
216190
npm publish --access public
217-
'
218191
rm -f ./.npmrc
219192

0 commit comments

Comments
 (0)