Skip to content

ci: check for NOCOMMIT flag #138

ci: check for NOCOMMIT flag

ci: check for NOCOMMIT flag #138

Workflow file for this run

name: "CI/CD"
"on":
pull_request: {}
push:
branches: ["**"]
tags: ["**"]
defaults:
run:
# For the windows phase
shell: bash
jobs:
build:
timeout-minutes: 10
name: "Build and Test"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
-
name: Tangle code and export HTML
run: "nix build .#dist"
-
name: "Test: integration test"
run: nix flake check
-
name: Create artifact bundle
run: |
(cd result/bin && tar cvf $OLDPWD/executables.tar *)
(cd result/doc && tar cvf $OLDPWD/website.tar index.html style.css)
-
uses: actions/upload-artifact@v4
name: "Upload website artifacts"
with:
name: website-${{github.sha}}
path: website.tar
-
uses: actions/upload-artifact@v4
name: "Upload binary artifacts"
with:
name: executables-${{github.sha}}
path: executables.tar
test-nonix:
timeout-minutes: 10
name: "Test stand-alone binary without Nix"
needs: build
strategy:
fail-fast: false
matrix:
config:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.config }}
steps:
- uses: actions/download-artifact@v4
with:
name: executables-${{github.sha}}
- name: Unpack artifacts
run: |
tar xvf executables.tar
rm -f executables.tar
- name: Run tests
run: |
./tomono-test
deploy_pages:
timeout-minutes: 10
if: ${{ github.ref_type == 'branch' && github.ref == 'refs/heads/master' }}
name: "Deploy the HTML to GitHub Pages"
runs-on: ubuntu-latest
needs: build
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
-
uses: actions/download-artifact@v4
with:
name: website-${{github.sha}}
- name: Unpack artifacts
run: |
tar xvf website.tar
rm -f website.tar
-
name: configure git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "<>"
-
name: "Commit the HTML to gh-pages branch"
run: |
git add -A
git commit -m "Update gh-pages from ${{github.ref}} @ ${{github.sha}}"
git push origin gh-pages
nocommit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nobssoftware/nocommit@v1
name: "nocommit checker"