Skip to content

Commit

Permalink
Adds release CI and modifies existing build tooling (#264)
Browse files Browse the repository at this point in the history
This change adds new tooling to "release" built executables via GitHub Actions and GitHub Release. This change also refactors existing build tooling to accommodate the following:
- Changes the executable name to include the version identifier.
- Changes the structure of the bin directory.
- Reduces duplicate GitHub Action workflows via workflow calls.
- Changes Docker image cache strategy to use the GHA backend.
- Refactors the Dockerfile to use Ubuntu for CI.
- Isolates Cypress tooling in `./test/cy.`
- Isolates Bats tooling in `./test/bats.`
- Fixes various issues in Justfiles to properly work in Docker.
- Defaults the env `DOCKER` variable to false when env `CI` is false.
  • Loading branch information
tdstein authored Oct 18, 2023
1 parent 20af44f commit 55a97b9
Show file tree
Hide file tree
Showing 53 changed files with 3,344 additions and 5,041 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
32 changes: 32 additions & 0 deletions .github/workflows/agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Agent
on:
workflow_call:
jobs:
agent:
runs-on: ubuntu-latest
steps:
- uses: crazy-max/ghaction-github-runtime@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
- run: just lint
- run: just test
57 changes: 57 additions & 0 deletions .github/workflows/bats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Bats
on:
workflow_call:
jobs:
native:
env:
DOCKER: false
strategy:
fail-fast: false
matrix:
runner: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: actions/download-artifact@v3
with:
name: executables
path: bin
- run: chmod -R +x ./bin
- run: just bats
docker:
env:
DOCKER: true
runs-on: ubuntu-latest
steps:
- uses: crazy-max/ghaction-github-runtime@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
- uses: actions/download-artifact@v3
with:
name: executables
path: bin
- run: chmod -R +x ./bin
- run: just bats
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build
env:
MODE: prod
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: crazy-max/ghaction-github-runtime@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
- run: just web install
- run: just web build
- run: just build
- uses: actions/upload-artifact@v3
id: upload
with:
name: executables
path: bin/**/*
23 changes: 23 additions & 0 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Cypress
on:
workflow_call:
jobs:
native:
env:
DOCKER: false
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: actions/download-artifact@v3
with:
name: executables
path: bin
- run: chmod -R +x ./bin
- run: just cy
18 changes: 18 additions & 0 deletions .github/workflows/extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Extensions
on:
workflow_call:
jobs:
jupyterlab:
env:
DOCKER: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- run: just jupyterlab install
- run: just jupyterlab lint
- run: just jupyterlab test
31 changes: 31 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Image
on:
workflow_call:
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: crazy-max/ghaction-github-runtime@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles('./build/ci/Dockerfile') }}
- uses: reproducible-containers/[email protected]
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
- run: just image
Loading

0 comments on commit 55a97b9

Please sign in to comment.