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 154baef
Show file tree
Hide file tree
Showing 8 changed files with 300 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 }}"
115 changes: 115 additions & 0 deletions .github/workflows/env-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# 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
steps:
- uses: actions/checkout@v4
- name: Get base
shell: bash
run: |
curl -sLO https://community-tc.services.mozilla.com/api/queue/v1/task/fDhBh60DSDWAr4QRbpX97A/runs/0/artifacts/public/msys2.tar.zst
mkdir -p "cache/index.project.git-cinnabar.env.msys.x86_64.7270fecfdaac8d68a6b959e87308c5b593f5ef16/public"
mv msys2.tar.zst "cache/index.project.git-cinnabar.env.msys.x86_64.7270fecfdaac8d68a6b959e87308c5b593f5ef16/public"
- uses: ./.github/actions/task
with:
name: "msys2 image: ${{ matrix.image }} x86_64"
output: msys2.tar.zst
# 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.

4 changes: 3 additions & 1 deletion CI/msys.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def prepare_params(self, params):
command = []
command.append("set HOME=%CD%")
command.append("set ARTIFACTS=%CD%")
command.append("set PATH=")
for path in (mingw(self.cpu), "usr"):
command.append(
"set PATH=%CD%\\{}\\{}\\bin;%PATH%".format(msys(self.cpu), path)
Expand Down Expand Up @@ -115,7 +116,8 @@ def __init__(self, name):
"pacman-key --init",
"pacman-key --populate msys2",
"pacman-key --refresh",
"pacman --noconfirm -Sy procps tar {}".format(
"env",
"pacman --noconfirm -Syvvv procps tar {}".format(
" ".join(self.packages(name))
),
"pkill gpg-agent",
Expand Down
Loading

0 comments on commit 154baef

Please sign in to comment.