From 4ae38ec2c9d8eea6b7ad12e5b43209738ced66eb Mon Sep 17 00:00:00 2001 From: ge Date: Sun, 13 Apr 2025 05:54:27 +0300 Subject: [PATCH] ci: add CI --- .github/workflows/docs.yaml | 48 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 24 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/docs.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..d0e08a0 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,48 @@ +name: Docs +on: + push: + branches: [ "master" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup V + run: | + wget -qO /tmp/v.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip + unzip -q /tmp/v.zip -d /tmp + echo /tmp/v >> "$GITHUB_PATH" + + - name: Build docs + run: | + v doc -f html -m . + pushd _docs + ln -vs embedfs.html index.html + ls -alFh + popd + + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: _docs/ + + deploy: + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + +permissions: + contents: read + pages: write + id-token: write diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..f9d8c51 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,24 @@ +name: Tests +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup V + run: | + wget -qO /tmp/v.zip https://github.com/vlang/v/releases/latest/download/v_linux.zip + unzip -q /tmp/v.zip -d /tmp + echo /tmp/v >> "$GITHUB_PATH" + + - name: Run tests + run: | + v -stats test .