Skip to content

Commit

Permalink
chore: CI improvements.
Browse files Browse the repository at this point in the history
This commit features several CI improvements:

- Clearer naming of CI files, pipelines, and jobs.
- Adds "website-test.yml" to test website changes on PRs.
- Removes duplicative tests on `main` after equivalent tests
  on PRs, given that PRs can only merge with passing tests.

Signed-off-by: Andrew Lilley Brinker <[email protected]>
  • Loading branch information
alilleybrinker committed Aug 9, 2024
1 parent 10130df commit 3977498
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
name: Conventional Commits
name: Commits

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always

jobs:
conventional-commits:
name: Check Format
name: Conventional Commits
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Hub Image Publish
name: Docker Hub

on:
release:
Expand All @@ -10,7 +10,7 @@ on:
required: true

jobs:
docker:
push:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/test.yml → .github/workflows/hipcheck.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: CI
name: Hipcheck

# Run on PRs before merging. We disallow pushing directly to main
# without going through a PR, so we don't run on `push` events for main.
on:
push:
branches: [main]
paths:
- "config/**"
- "hipcheck/**"
- "scripts/**"
- "xtask/**"
pull_request:
branches: [main]
paths:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Deploy Website
name: Website

# Runs on pushed to the default branch but can also be
# run manually from the GitHub Actions page.
on:
push:
branches: [$default-branch]
branches: [main]
workflow_dispatch:

# Sets permissions of the `GITHUB_TOKEN` to allow deployment to GitHub Pages
Expand All @@ -24,7 +24,7 @@ jobs:
#==========================================================================
# Build the Hipcheck site with Zola and the Tailwindcss CLI
#--------------------------------------------------------------------------
build:
website-build:
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
#==========================================================================
# Deploy the site to GitHub Pages
#--------------------------------------------------------------------------
deploy:
website-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/website-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Website

# Run when PRs would modify the site code.
on:
pull_request:
branches: [main]
paths:
- "site/**"

permissions:
contents: read

jobs:
#==========================================================================
# Build the Hipcheck site with Zola and the Tailwindcss CLI
#--------------------------------------------------------------------------
website-test:
runs-on: ubuntu-latest

env:
TAILWIND_VERSION: 3.4.4

steps:
# Check out the Hipcheck repository.
- name: Checkout Hipcheck Repository
uses: actions/checkout@v4

# Install the latest version of Zola.
- name: Install Zola
uses: taiki-e/install-action@v2
with:
tool: [email protected]

# Install the latest version of the Tailwind CLI.
- name: Install Tailwind CLI
run: |
curl --proto '=https' --tlsv1.2 -sSLO https://github.com/tailwindlabs/tailwindcss/releases/download/v${TAILWIND_VERSION}/tailwindcss-linux-x64
chmod +x tailwindcss-linux-x64
mv tailwindcss-linux-x64 tailwindcss
mkdir -p "${HOME}/.local/bin"
mv tailwindcss "${HOME}/.local/bin/tailwindcss"
echo "${HOME}/.local/bin" >> $GITHUB_PATH
# Build the actual site with Zola and Tailwind.
- name: Build Hipcheck Website
run: |
cd site
zola build
tailwindcss -i styles/main.css -o public/main.css

0 comments on commit 3977498

Please sign in to comment.