-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
162 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,64 +12,37 @@ permissions: | |
pages: write | ||
id-token: write | ||
|
||
env: | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
MOD_PATH: ~/.vmodules/vibe/ | ||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: ${{ github.ref_name != 'main' }} | ||
|
||
jobs: | ||
debounce: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
outputs: | ||
abort: ${{ steps.debounce.outputs.abort }} | ||
steps: | ||
- name: Debounce | ||
if: github.event_name == 'push' && github.ref_name != 'main' | ||
id: debounce | ||
run: | | ||
pr_branches=$(gh pr list --json headRefName --repo $GITHUB_REPOSITORY) | ||
if [[ $(echo "$pr_branches" | jq -r --arg GITHUB_REF '.[].headRefName | select(. == $GITHUB_REF)') ]]; then | ||
echo "This push is associated with a pull request. Skipping the job." | ||
echo "abort=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
check-docs: | ||
needs: debounce | ||
if: needs.debounce.outputs.abort != 'true' | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Restore Cache | ||
- name: Restore cache | ||
id: cache-status | ||
uses: actions/cache/restore@v3 | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
vlang | ||
~/v | ||
~/.vmodules | ||
key: ubuntu-latest${{ github.sha }} | ||
- name: Setup V | ||
uses: vlang/[email protected] | ||
run: ~/v/v symlink && v version | ||
- name: Setup Dependencies | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libcurl4-openssl-dev | ||
version: 1.0 | ||
- name: Checkout ${{ env.REPO_NAME }} | ||
if: ${{ steps.cache-status.outputs.cache-hit != 'true' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.REPO_NAME }} | ||
- name: Copy ${{ env.REPO_NAME }} to .vmodules | ||
if: ${{ steps.cache-status.outputs.cache-hit != 'true' }} | ||
run: cp -r ${{ env.REPO_NAME }} ${{ env.MOD_PATH }} | ||
- name: Check Markdown | ||
run: v check-md -hide-warnings ${{ env.MOD_PATH }} | ||
- name: Check markdown | ||
run: v check-md -hide-warnings ~/.vmodules/vibe | ||
|
||
deploy: | ||
if: github.event_name == 'push' && github.ref_name == 'main' | ||
if: github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'ttytm/vibe' | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: pages | ||
|
@@ -78,20 +51,24 @@ jobs: | |
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Install V | ||
uses: vlang/[email protected] | ||
- name: Setup pages | ||
uses: actions/configure-pages@v5 | ||
- name: Restore cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
check-latest: true | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
path: | | ||
~/v | ||
~/.vmodules | ||
key: ubuntu-latest-${{ github.sha }} | ||
fail-on-cache-miss: true | ||
- name: Setup V | ||
run: ~/v/v symlink && v version | ||
- name: Build docs | ||
run: docs/build.vsh | ||
run: ~/.vmodules/vibe/docs/build.vsh | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'docs/site' | ||
- name: Deploy to GitHub Pages | ||
- name: Deploy to GitHub pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 | ||
uses: actions/deploy-pages@v4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,39 +3,21 @@ name: Lint | |
on: | ||
workflow_call: | ||
|
||
env: | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
MOD_PATH: ~/.vmodules/vibe/ | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Restore Cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
vlang | ||
~/.vmodules | ||
key: ubuntu-latest-${{ github.sha }} | ||
fail-on-cache-miss: true | ||
- name: Setup V | ||
uses: vlang/[email protected] | ||
- name: Check Formatting | ||
run: v fmt -verify ${{ env.MOD_PATH }} | ||
|
||
vet: | ||
verify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Restore Cache | ||
uses: actions/cache/restore@v3 | ||
- name: Restore cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
vlang | ||
~/v | ||
~/.vmodules | ||
key: ubuntu-latest-${{ github.sha }} | ||
fail-on-cache-miss: true | ||
- name: Setup V | ||
uses: vlang/[email protected] | ||
- name: Vet ${{ env.REPO_NAME }} | ||
run: v vet -W ${{ env.MOD_PATH }}/src/ | ||
run: ~/v/v symlink && v version | ||
- name: Verify formatting | ||
run: v fmt -verify ~/.vmodules/vibe && exit 0 || v fmt -diff . && exit 1 | ||
- name: Vet | ||
run: v vet -W ~/.vmodules/vibe |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,6 @@ name: CI | |
on: | ||
workflow_call: | ||
|
||
env: | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
MOD_PATH: ~/.vmodules/vibe | ||
|
||
jobs: | ||
setup: | ||
strategy: | ||
|
@@ -15,26 +11,28 @@ jobs: | |
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install V | ||
uses: vlang/[email protected] | ||
- name: Checkout V | ||
uses: actions/checkout@v4 | ||
with: | ||
check-latest: true | ||
repository: 'vlang/v' | ||
path: v | ||
- name: Setup V | ||
run: mv v ~/v && cd ~/v && make -j4 | ||
- name: Setup Dependencies | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libcurl4-openssl-dev | ||
version: 1.0 | ||
- name: Checkout ${{ env.REPO_NAME }} | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.REPO_NAME }} | ||
- name: Setup ${{ env.REPO_NAME }} | ||
run: cp -r ${{ env.REPO_NAME }} ${{ env.MOD_PATH }} | ||
- name: Cache | ||
uses: actions/cache/save@v3 | ||
path: vibe | ||
- name: Setup V module | ||
run: mv vibe ~/.vmodules/vibe | ||
- name: Save cache | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
vlang | ||
~/v | ||
~/.vmodules | ||
key: ${{ matrix.os }}-${{ github.sha }} | ||
|
||
|
@@ -48,67 +46,65 @@ jobs: | |
matrix: | ||
os: [ubuntu-20.04, ubuntu-latest] | ||
cc: [tcc, gcc, clang] | ||
optimization: ['', -prod, -cstrict] | ||
optimization: ['', '-W -cstrict'] | ||
exclude: | ||
- cc: tcc | ||
optimization: -prod | ||
optimization: '-W -cstrict' | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
VFLAGS: -cg -stats -cc ${{ matrix.cc }} ${{ matrix.optimization }} | ||
VFLAGS: -cg -cc ${{ matrix.cc }} ${{ matrix.optimization }} | ||
steps: | ||
- name: Restore Cache | ||
uses: actions/cache/restore@v3 | ||
- name: Restore cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
vlang | ||
~/v | ||
~/.vmodules | ||
key: ${{ matrix.os }}-${{ github.sha }} | ||
fail-on-cache-miss: true | ||
- name: Setup V | ||
uses: vlang/[email protected] | ||
run: ~/v/v symlink && v -showcc self && v doctor | ||
- name: Setup Dependencies | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libcurl4-openssl-dev | ||
version: 1.0 | ||
- name: Build | ||
run: v -shared ${{ env.MOD_PATH }} | ||
- name: Run tests | ||
run: v ${{ env.VFLAGS }} test ${{ env.MOD_PATH }} | ||
run: v -stats test ~/.vmodules/vibe | ||
|
||
test-sanitzed: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cc: [gcc, clang] | ||
sanitizer: [address, leak] | ||
include: | ||
- cc: gcc | ||
sanitizer: thread | ||
- cc: gcc | ||
sanitizer: address,leak,undefined,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,bounds-strict,alignment,object-size,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr | ||
- cc: clang | ||
sanitizer: undefined | ||
- cc: clang | ||
sanitizer: memory | ||
fail-fast: false | ||
env: | ||
VFLAGS: -cg -stats -cc ${{ matrix.cc }} | ||
VFLAGS: -cg -cc ${{ matrix.cc }} | ||
steps: | ||
- name: Restore Cache | ||
uses: actions/cache/restore@v3 | ||
- name: Restore cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
vlang | ||
~/v | ||
~/.vmodules | ||
key: ubuntu-latest-${{ github.sha }} | ||
fail-on-cache-miss: true | ||
- name: Setup V | ||
uses: vlang/[email protected] | ||
run: ~/v/v symlink && v -showcc self && v doctor | ||
- name: Setup Dependencies | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libcurl4-openssl-dev | ||
version: 1.0 | ||
- name: Run tests | ||
run: | | ||
if [[ ${{ matrix.cc }} == "gcc" && ${{ matrix.sanitizer }} == "address" ]]; then | ||
cmd="v ${{ env.VFLAGS }} -cflags -fsanitize=address -cflags -fsanitize-address-use-after-scope -cflags -fsanitize=pointer-compare -cflags -fsanitize=pointer-subtract test ${{ env.MOD_PATH }}" | ||
else | ||
cmd="v ${{ env.VFLAGS }} -cflags -fsanitize=${{ matrix.sanitizer }} test ${{ env.MOD_PATH }}" | ||
fi | ||
echo "$cmd" | ||
eval "$cmd" | ||
run: v -cflags -fsanitize=${{ matrix.sanitizer }} -stats test ~/.vmodules/vibe |
Oops, something went wrong.