Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Apr 4, 2024
1 parent 99c42d2 commit 8e95f35
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 28 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,21 @@ concurrency:
group: "${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
cancel-in-progress: true
jobs:
calculate_matrix:
name: Calculate job matrix
runs-on: ubuntu-latest
outputs:
jobs: "${{ steps.jobs.outputs.jobs }}"
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Calculate the CI job matrix
run: python3 src/ci/scripts/calculate-job-matrix.py >> $GITHUB_OUTPUT
id: jobs
pr:
name: "PR - ${{ matrix.name }}"
needs:
- calculate_matrix
env:
PR_CI_JOB: 1
CI_JOB_NAME: "${{ matrix.name }}"
Expand All @@ -51,20 +64,7 @@ jobs:
continue-on-error: "${{ matrix.name == 'mingw-check-tidy' }}"
strategy:
matrix:
include:
- name: mingw-check
os: ubuntu-20.04-4core-16gb
env: {}
- name: mingw-check-tidy
os: ubuntu-20.04-4core-16gb
env: {}
- name: x86_64-gnu-llvm-17
env:
ENABLE_GCC_CODEGEN: "1"
os: ubuntu-20.04-16core-64gb
- name: x86_64-gnu-tools
os: ubuntu-20.04-16core-64gb
env: {}
include: "${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}"
defaults:
run:
shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}"
Expand Down
27 changes: 13 additions & 14 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,30 +340,29 @@ concurrency:
cancel-in-progress: true

jobs:
calculate_matrix:
name: Calculate job matrix
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.jobs.outputs.jobs }}
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Calculate the CI job matrix
run: python3 src/ci/scripts/calculate-job-matrix.py >> $GITHUB_OUTPUT
id: jobs
pr:
<<: *base-ci-job
name: PR - ${{ matrix.name }}
needs: [ calculate_matrix ]
env:
<<: [*shared-ci-variables, *public-variables]
PR_CI_JOB: 1
if: github.event_name == 'pull_request'
continue-on-error: ${{ matrix.name == 'mingw-check-tidy' }}
strategy:
matrix:
include:
- name: mingw-check
<<: *job-linux-4c

- name: mingw-check-tidy
<<: *job-linux-4c

- name: x86_64-gnu-llvm-17
env:
ENABLE_GCC_CODEGEN: "1"
<<: *job-linux-16c

- name: x86_64-gnu-tools
<<: *job-linux-16c
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}

auto:
<<: *base-ci-job
Expand Down
23 changes: 23 additions & 0 deletions src/ci/scripts/calculate-job-matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3

import json

if __name__ == "__main__":
data = [dict(
name="mingw-check",
os="ubuntu-20.04-4core-16gb",
env={}
), dict(
name="mingw-check-tidy",
os="ubuntu-20.04-4core-16gb",
env={}
), dict(
name="x86_64-gnu-llvm-17",
os="ubuntu-20.04-16core-64gb",
env=dict(ENABLE_GCC_CODEGEN="1")
), dict(
name="x86_64-gnu-tools",
os="ubuntu-20.04-16core-64gb",
env={}
)]
print(f"jobs={json.dumps(data)}")

0 comments on commit 8e95f35

Please sign in to comment.