Skip to content

Commit 95afb42

Browse files
Switch from Node to Bun in CI
1 parent 075cfeb commit 95afb42

File tree

1 file changed

+65
-67
lines changed

1 file changed

+65
-67
lines changed

.github/workflows/main.yml

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,78 @@ on:
33
push:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 * * * *'
6+
- cron: "0 * * * *"
77
jobs:
88
main:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Check out the source code
12-
uses: actions/checkout@v3
13-
with:
14-
ref: main
15-
fetch-depth: 0
16-
17-
- name: Drop history of auto-generated files (readme.md, prs.md issues.md)
18-
run: |
19-
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --force --index-filter "git rm --ignore-unmatch readme.md prs.md issues.md" --prune-empty HEAD
11+
- name: Check out the source code
12+
uses: actions/checkout@v3
13+
with:
14+
ref: main
15+
fetch-depth: 0
2016

21-
- name: Use latest Node version to get access to modern features
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: latest
17+
- name: Drop history of auto-generated files (readme.md, prs.md issues.md)
18+
run: |
19+
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --force --index-filter "git rm --ignore-unmatch readme.md prs.md issues.md" --prune-empty HEAD
2520
26-
- name: Run the workflow script using the integration personal access token
27-
run: |
28-
npm install
29-
node test
30-
node . ${{github.token}}
31-
32-
- name: Upload JSON response artifacts for debugging in case of failure
33-
if: failure()
34-
uses: actions/upload-artifact@v4
35-
with:
36-
name: debugging-artifacts
37-
path: '*.artifact.json'
38-
39-
- name: Upload the followers.json cache file as an artifact
40-
uses: actions/upload-artifact@v4
41-
with:
42-
name: followers.json
43-
path: followers.json
21+
- name: Install Bun
22+
uses: oven-sh/setup-bun@v2
4423

45-
- name: Upload the repositories.json cache file as an artifact
46-
uses: actions/upload-artifact@v4
47-
with:
48-
name: repositories.json
49-
path: repositories.json
24+
- name: Run the workflow script using the integration personal access token
25+
run: |
26+
npm install
27+
bun test
28+
bun . ${{github.token}}
5029
51-
- name: Upload the todos.json cache file as an artifact
52-
uses: actions/upload-artifact@v4
53-
with:
54-
name: todos.json
55-
path: todos.json
30+
- name: Upload JSON response artifacts for debugging in case of failure
31+
if: failure()
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: debugging-artifacts
35+
path: "*.artifact.json"
5636

57-
- name: Commit and force push Git changes back to the workflow repository
58-
run: |
59-
set -e
60-
set -x
61-
62-
# Configure Git for the push from the workflow to the repository
63-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
64-
git config --global user.name "github-actions[bot]"
37+
- name: Upload the followers.json cache file as an artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: followers.json
41+
path: followers.json
6542

66-
# Stage the Git index change of the auto-generated readme.md file
67-
git add readme.md prs.md issues.md
68-
git add by-name-asc.md by-name-desc.md
69-
git add by-pushed_at-asc.md by-pushed_at-desc.md
70-
git add by-size-asc.md by-size-desc.md
71-
git add by-updated_at-asc.md by-updated_at-desc.md
72-
73-
# Bail if there are no changes to commit and hence no GitHub Pages to build
74-
if git diff-index --quiet HEAD --; then
75-
exit
76-
fi
77-
78-
# Commit the staged changes to the workflow repository
79-
git commit -m "Generate the profile repository readme" -m "This commit was automatically generated via GitHub Actions"
80-
81-
# Push the commit to the workflow repository using force since we rewrote history
82-
git push origin HEAD:main --force
43+
- name: Upload the repositories.json cache file as an artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: repositories.json
47+
path: repositories.json
48+
49+
- name: Upload the todos.json cache file as an artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: todos.json
53+
path: todos.json
54+
55+
- name: Commit and force push Git changes back to the workflow repository
56+
run: |
57+
set -e
58+
set -x
59+
60+
# Configure Git for the push from the workflow to the repository
61+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
62+
git config --global user.name "github-actions[bot]"
63+
64+
# Stage the Git index change of the auto-generated readme.md file
65+
git add readme.md prs.md issues.md
66+
git add by-name-asc.md by-name-desc.md
67+
git add by-pushed_at-asc.md by-pushed_at-desc.md
68+
git add by-size-asc.md by-size-desc.md
69+
git add by-updated_at-asc.md by-updated_at-desc.md
70+
71+
# Bail if there are no changes to commit and hence no GitHub Pages to build
72+
if git diff-index --quiet HEAD --; then
73+
exit
74+
fi
75+
76+
# Commit the staged changes to the workflow repository
77+
git commit -m "Generate the profile repository readme" -m "This commit was automatically generated via GitHub Actions"
78+
79+
# Push the commit to the workflow repository using force since we rewrote history
80+
git push origin HEAD:main --force

0 commit comments

Comments
 (0)