Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jan 25, 2025
1 parent fd79776 commit 6fc6b2e
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 119 deletions.
69 changes: 69 additions & 0 deletions .github/actions/task/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Task
description: Run task
inputs:
name:
description: task name
required: true
output:
description: pattern of output files
required: true
image:
description: docker image
dep1_name:
description: name of the first dependency
dep1_artifact:
description: name of the artifact from the first dependency
runs:
using: "composite"
steps:
- name: Docker image key
if: ${{ runner.os == 'Linux' && inputs.image }}
id: image-key
shell: bash
run: |
echo key=$(python3 CI/run.py --route "docker image: ${{ inputs.image }}") >> $GITHUB_OUTPUT
- name: Dependency key
if: ${{ inputs.dep1_name }}
id: dep1-key
shell: bash
run: |
echo key=$(python3 CI/run.py --route "${{ inputs.dep1_name }}") >> $GITHUB_OUTPUT
- name: Artifact key
id: artifact-key
shell: bash
run: |
echo key=$(python3 CI/run.py --route "${{ inputs.name }}") >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: cache
with:
path: ${{ inputs.output }}
key: ${{ steps.artifact-key.outputs.key }}
enableCrossOsArchive: true
- uses: actions/cache/restore@v4
if: ${{ runner.os == 'Linux' && inputs.image && steps.cache.outputs.cache-hit != 'true' }}
with:
path: dockerImage.tar.zst
key: ${{ steps.image-key.outputs.key }}
- uses: actions/cache/restore@v4
if: ${{ inputs.dep1_name && steps.cache.outputs.cache-hit != 'true' }}
with:
path: ${{ inputs.dep1_artifact }}
key: ${{ steps.dep1-key.outputs.key }}
enableCrossOsArchive: true
- name: Prepare podman cache
if: ${{ runner.os == 'Linux' && inputs.image && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
mkdir -p "cache/${{ steps.image-key.outputs.key }}/public"
mv dockerImage.tar.zst "cache/${{ steps.image-key.outputs.key }}/public"
- name: Prepare dependency cache
if: ${{ inputs.dep1_name && steps.cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
mkdir -p "cache/${{ steps.dep1-key.outputs.key }}/public"
mv ${{ inputs.dep1_artifact }} "cache/${{ steps.dep1-key.outputs.key }}/public"
- name: ${{ inputs.name }}
shell: bash
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
python3 CI/run.py --cache cache --out . "${{ inputs.name }}"
111 changes: 111 additions & 0 deletions .github/workflows/env-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# TODO: https://stackoverflow.com/questions/59180385/using-an-array-of-values-to-repeat-a-step-in-github-actions-workflow
name: environment and tools
on: [push]
jobs:
docker-base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/task
with:
name: "docker image: base"
output: dockerImage.tar.zst

docker:
needs: docker-base
strategy:
fail-fast: false
matrix:
image:
- build
- build-tools
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/task
with:
name: "docker image: ${{ matrix.image }}"
output: dockerImage.tar.zst
image: base

msys-base:
runs-on: ubuntu-latest
needs: docker-base
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/task
with:
name: "msys2 image: base x86_64"
output: msys2.tar.zst
image: base

msys:
strategy:
fail-fast: false
matrix:
image:
- build
- test
runs-on: windows-latest
needs: msys-base
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/task
with:
name: "msys2 image: ${{ matrix.image }} x86_64"
output: msys2.tar.zst
image: build-tools
dep1_name: "msys2 image: base x86_64"
dep1_artifact: msys2.tar.zst

git:
strategy:
fail-fast: false
matrix:
version:
- 1.8.5
- 2.7.4
- 2.47.1
- 2.47.1.windows.1 windows x86_64
runs-on: ubuntu-latest
needs: docker
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/task
with:
name: git v${{ matrix.version }}
output: git-*.tar.zst
image: build-tools

mercurial:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
image: [build-tools]
version:
- 1.9.3
- 2.5.4
- 3.4.2
- 6.8
include:
- os: windows-latest
version: 6.8 windows x86_64
dep1_name: "msys2 image: build x86_64"
dep1_artifact: msys2.tar.zst
- os: macos-13
version: 6.8 macos x86_64
- os: macos-14
version: 6.8 macos arm64
runs-on: ${{ matrix.os }}
needs: [docker, msys]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/task
with:
name: hg v${{ matrix.version }}
output: mercurial-*.whl
image: ${{ matrix.image }}
dep1_name: ${{ matrix.dep1_name }}
dep1_artifact: ${{ matrix.dep1_artifact }}
26 changes: 0 additions & 26 deletions .github/workflows/taskcluster.yml

This file was deleted.

90 changes: 0 additions & 90 deletions .taskcluster.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CI/msys.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def __init__(self, name):
"pkill gpg-agent",
"pkill dirmngr",
"rm -rf /var/cache/pacman/pkg",
"python3 -m ensurepip",
"python3 -m pip install pip==22.2.2 wheel==0.37.1 --upgrade",
"mv {}/{}/bin/{{mingw32-,}}make.exe".format(msys(cpu), mingw(cpu)),
"tar -c --hard-dereference {} | zstd -c > msys2.tar.zst".format(msys(cpu)),
Expand Down Expand Up @@ -151,7 +152,6 @@ def mingw_packages(pkgs):
"curl",
"make",
"python3",
"python3-pip",
]
)

Expand Down
Loading

0 comments on commit 6fc6b2e

Please sign in to comment.