Fix #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- "*" | |
jobs: | |
test-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: "Workaround: Prepare ~/.local/share/chezmoi" | |
run: | | |
ln -s "$(pwd)" "$HOME/.local/share/chezmoi" | |
- name: Install dependencies | |
run: | | |
sudo apt install -y zsh | |
- name: Install goss | |
run: | | |
sudo curl -L https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss | |
sudo chmod +rx /usr/local/bin/goss | |
- uses: jdx/mise-action@v2 | |
- name: Run test | |
run: | | |
deno task bootstrap | |
# Run script twice to test idempotency | |
deno task bootstrap | |
goss validate --format documentation | |
test-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: "Workaround: Prepare ~/.local/share/chezmoi" | |
run: | | |
ln -s "$(pwd)" "$HOME/.local/share/chezmoi" | |
- name: Install goss | |
run: | | |
sudo curl -L https://github.com/goss-org/goss/releases/latest/download/goss-darwin-amd64 -o /usr/local/bin/goss | |
sudo chmod +rx /usr/local/bin/goss | |
- uses: jdx/mise-action@v2 | |
- name: Run test | |
run: | | |
deno task bootstrap | |
# Run script twice to test idempotency | |
deno task bootstrap | |
GOSS_USE_ALPHA=1 goss validate --format documentation | |
test-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: "Workaround: Prepare ~/.local/share/chezmoi" | |
run: | | |
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.local\share" | |
New-Item -ItemType SymbolicLink -Value (Get-Location) -Path "$env:USERPROFILE\.local\share\chezmoi" | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Run test | |
run: | | |
deno task bootstrap | |
# Run script twice to test idempotency | |
deno task bootstrap | |
test-static: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: jdx/mise-action@v2 | |
- name: Install dependencies | |
run: sudo apt install -y zsh | |
- name: Run test | |
run: deno run -A ./test/static.ts | |
actionlint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Download actionlint | |
id: get_actionlint | |
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) | |
shell: bash | |
- name: Check workflow files | |
run: ${{ steps.get_actionlint.outputs.executable }} -color | |
shell: bash | |
release: | |
needs: [test-linux, test-macos, test-windows, test-static, actionlint] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: jdx/mise-action@v2 | |
- name: Build | |
run: | | |
deno task build | |
- id: generate-version | |
run: | | |
echo "version=v$(date --utc '+%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT" | |
- uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.generate-version.outputs.version }} | |
files: | | |
bootstrap/_build/* |