2023-11-17 15:58:17 -08:00
|
|
|
name: Test
|
|
|
|
|
2023-02-22 17:47:24 -08:00
|
|
|
on:
|
2023-11-17 15:58:17 -08:00
|
|
|
workflow_dispatch:
|
2023-02-22 17:47:24 -08:00
|
|
|
pull_request:
|
2023-11-17 15:58:17 -08:00
|
|
|
push:
|
2023-02-22 17:47:24 -08:00
|
|
|
branches:
|
|
|
|
- main
|
2023-11-17 15:58:17 -08:00
|
|
|
|
|
|
|
permissions:
|
2024-06-21 21:11:16 +02:00
|
|
|
contents: write
|
2023-11-17 15:58:17 -08:00
|
|
|
|
2023-02-22 17:47:24 -08:00
|
|
|
jobs:
|
2024-06-21 21:11:16 +02:00
|
|
|
remove-cache:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions: write-all
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install github cli
|
|
|
|
run: |
|
|
|
|
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
|
|
|
|
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
|
|
|
|
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
|
|
|
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
|
|
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
|
|
|
&& sudo apt update \
|
|
|
|
&& sudo apt install gh -y
|
2024-10-08 15:30:45 +02:00
|
|
|
|
2024-06-21 21:11:16 +02:00
|
|
|
- run: |
|
|
|
|
gh cache delete --all || true
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
|
2024-11-16 11:56:08 +01:00
|
|
|
tests:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Bun
|
|
|
|
uses: ./
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: bun install
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: bun test --coverage
|
|
|
|
|
2023-02-22 17:47:24 -08:00
|
|
|
setup-bun:
|
|
|
|
runs-on: ${{ matrix.os }}
|
2023-02-22 17:57:41 -08:00
|
|
|
continue-on-error: true
|
2024-11-16 11:56:08 +01:00
|
|
|
needs: [remove-cache, tests]
|
2023-02-22 17:47:24 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
2024-04-02 11:24:51 +02:00
|
|
|
- windows-latest
|
2023-02-22 17:47:24 -08:00
|
|
|
bun-version:
|
|
|
|
- latest
|
|
|
|
- canary
|
2024-04-02 11:24:51 +02:00
|
|
|
- "1.1.0"
|
2023-11-17 15:58:17 -08:00
|
|
|
- "1.x"
|
|
|
|
- "1"
|
|
|
|
- "> 1.0.0"
|
|
|
|
- "< 2"
|
|
|
|
# Disable <sha> support for now. This is because Github Artifacts
|
|
|
|
# expire after 90 days, and we don't have another source of truth yet.
|
|
|
|
# - "822a00c4d508b54f650933a73ca5f4a3af9a7983" # 1.0.0 commit
|
2023-02-22 17:47:24 -08:00
|
|
|
steps:
|
2023-11-17 15:58:17 -08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-04-02 11:24:51 +02:00
|
|
|
|
2023-11-17 15:58:17 -08:00
|
|
|
- name: Setup Bun
|
2023-02-22 17:47:24 -08:00
|
|
|
uses: ./
|
2024-04-03 14:01:25 +02:00
|
|
|
id: setup_bun
|
2023-02-22 17:47:24 -08:00
|
|
|
with:
|
|
|
|
bun-version: ${{ matrix.bun-version }}
|
2024-04-02 11:24:51 +02:00
|
|
|
|
2023-11-17 15:58:17 -08:00
|
|
|
- name: Run Bun
|
2024-04-03 14:01:25 +02:00
|
|
|
id: run_bun
|
2023-02-22 17:47:24 -08:00
|
|
|
run: |
|
|
|
|
bun --version
|
2024-04-03 14:01:25 +02:00
|
|
|
|
2024-06-21 21:11:16 +02:00
|
|
|
setup-bun-from-file:
|
|
|
|
name: setup-bun from (${{ matrix.os }}, ${{ matrix.file.name }})
|
2023-10-25 08:13:22 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-06-21 21:11:16 +02:00
|
|
|
continue-on-error: true
|
2024-11-16 11:56:08 +01:00
|
|
|
needs: [remove-cache, tests]
|
2023-10-25 08:13:22 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
2024-04-02 11:24:51 +02:00
|
|
|
- windows-latest
|
2024-06-21 21:11:16 +02:00
|
|
|
file:
|
|
|
|
- name: package.json (bun@1.1.0)
|
|
|
|
file: package.json
|
|
|
|
run: |
|
|
|
|
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
|
|
|
|
- name: package.json (yarn@bun@1.1.0)
|
|
|
|
file: package.json
|
|
|
|
run: |
|
|
|
|
echo "$(jq '. += {"packageManager": "yarn@bun@1.1.0"}' package.json)" > package.json
|
|
|
|
- name: .tool-versions (bun 1.1.0)
|
|
|
|
file: .tool-versions
|
|
|
|
run: |
|
|
|
|
echo "bun 1.1.0" > .tool-versions
|
|
|
|
- name: .tool-versions (bun1.1.0)
|
|
|
|
file: .tool-versions
|
|
|
|
run: |
|
|
|
|
echo "bun1.1.0" > .tool-versions
|
2024-07-31 05:30:50 +09:00
|
|
|
- name: .tool-versions (bun 1.1.0)
|
|
|
|
file: .tool-versions
|
|
|
|
run: |
|
|
|
|
echo "bun 1.1.0" > .tool-versions
|
2024-06-21 21:11:16 +02:00
|
|
|
- name: .bumrc (1.1.0)
|
|
|
|
file: .bumrc
|
|
|
|
run: |
|
|
|
|
echo "1.1.0" > .bumrc
|
|
|
|
- name: .bun-version (1.1.0)
|
|
|
|
file: .bun-version
|
|
|
|
run: |
|
|
|
|
echo "1.1.0" > .bun-version
|
2023-10-25 08:13:22 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-03-07 11:39:32 +01:00
|
|
|
uses: actions/checkout@v4
|
2024-04-02 11:24:51 +02:00
|
|
|
|
2024-06-21 21:11:16 +02:00
|
|
|
- name: Setup file
|
|
|
|
run: ${{ matrix.file.run }}
|
2024-04-02 11:24:51 +02:00
|
|
|
|
2023-10-25 08:13:22 -05:00
|
|
|
- name: Setup Bun
|
|
|
|
uses: ./
|
2024-06-21 21:11:16 +02:00
|
|
|
with:
|
|
|
|
bun-version-file: ${{ matrix.file.file }}
|
2024-04-02 11:24:51 +02:00
|
|
|
|
2024-06-21 21:11:16 +02:00
|
|
|
- name: Compare versions
|
|
|
|
uses: ./.github/actions/compare-bun-version
|
|
|
|
with:
|
|
|
|
bun-version: "1.1.0"
|
2024-10-08 15:30:45 +02:00
|
|
|
|
|
|
|
setup-bun-download-url:
|
|
|
|
name: setup-bun from (${{ matrix.os }}, download url)
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: true
|
2024-11-16 11:56:08 +01:00
|
|
|
needs: [remove-cache, tests]
|
2024-10-08 15:30:45 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Bun
|
|
|
|
uses: ./
|
|
|
|
id: setup_bun
|
|
|
|
with:
|
|
|
|
bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'aarch64' }}.zip"
|
|
|
|
|
|
|
|
- name: Run Bun
|
|
|
|
id: run_bun
|
|
|
|
run: |
|
|
|
|
bun --version
|