Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Only start a single container job #1466

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Build and Test

on: [push, pull_request]

env:
TESTS_TIMEOUT: 10 # in minutes

jobs:
build-container:
uses: ./.github/workflows/container.yml
permissions:
packages: write
on:
workflow_call:
inputs:
image:
required: true
type: string
image_options:
required: true
type: string

jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
needs: build-container
strategy:
matrix:
compiler: ['gcc', 'clang']
sanitizer: ['address']

container:
image: ${{ needs.build-container.outputs.image }}
image: ${{ inputs.image }}
env:
CFLAGS: -Wp,-D_FORTIFY_SOURCE=2
CC: ${{ matrix.compiler }}
TEST_IN_CI: 1
G_MESSAGES_DEBUG: all
options: ${{ needs.build-container.outputs.image_options }}
options: ${{ inputs.image_options }}

steps:
- name: Configure environment
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Create build container

env:
IMAGE_TAG: 20241008-1

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on: [push, pull_request]

jobs:
build-container:
name: Container
uses: ./.github/workflows/container.yml
permissions:
packages: write

build-and-test:
name: Build and Test
uses: ./.github/workflows/build-and-test.yml
needs: build-container
with:
image: ${{ needs.build-container.outputs.image }}
image_options: ${{ needs.build-container.outputs.image_options }}

pages:
name: Documentation & Website
uses: ./.github/workflows/pages.yml
needs: build-container
permissions:
contents: read
pages: write
id-token: write
with:
image: ${{ needs.build-container.outputs.image }}
image_options: ${{ needs.build-container.outputs.image_options }}
31 changes: 13 additions & 18 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
name: Documentation & Website

on: [push, pull_request]

permissions:
contents: read
pages: write
id-token: write
on:
workflow_call:
inputs:
image:
required: true
type: string
image_options:
required: true
type: string

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-container:
uses: ./.github/workflows/container.yml
permissions:
packages: write

build:
name: Build docs and website
runs-on: ubuntu-latest
needs: build-container
permissions:
contents: write

container:
image: ${{ needs.build-container.outputs.image }}
options: ${{ needs.build-container.outputs.image_options }}
image: ${{ inputs.image }}
options: ${{ inputs.image_options }}

steps:
- name: Check out xdg-desktop-portal
Expand All @@ -52,6 +46,7 @@ jobs:

# Deployment job
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

jobs:
build-container:
name: Container
uses: ./.github/workflows/container.yml
permissions:
packages: write
Expand Down
Loading