Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jan 26, 2025
1 parent fd79776 commit b4a8dae
Show file tree
Hide file tree
Showing 9 changed files with 363 additions and 223 deletions.
42 changes: 42 additions & 0 deletions .github/actions/mounts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Mount dependencies
description: Mount dependencies
inputs:
name:
description: task name
required: true
runs:
using: "composite"
steps:
- name: Compute dependencies
id: dependencies
shell: bash
run: |
python3 CI/run.py --mounts "${{ inputs.name }}" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v3
if: ${{ steps.dependencies.outputs.data }}
with:
node-version: '20.x'
- shell: bash
if: ${{ steps.dependencies.outputs.data }}
run: npm install @actions/cache
- name: Mount dependencies
if: ${{ steps.dependencies.outputs.data }}
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const cache = require('@actions/cache');
const data = ${{ toJSON(fromJSON(steps.dependencies.outputs.data)) }};
// Make actions/cache's getWorkingDirectory() return process.cwd.
delete process.env.GITHUB_WORKSPACE;
for (const mount of data) {
const dir = path.join('cache', mount.key, path.dirname(mount.artifact));
fs.mkdirSync(dir, { recursive: true });
process.chdir(dir);
if (await cache.restoreCache([path.basename(mount.artifact)], mount.key, [], {}, true)) {
console.log(`Cache restored from key: ${mount.key}`);
} else {
core.setFailed(`Failed to restore cache from key: ${mount.key}`);
}
}
38 changes: 38 additions & 0 deletions .github/actions/task/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Task
description: Run task
inputs:
name:
description: task name
required: true
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
if: ${{ runner.os == 'macOS' }}
with:
python-version: ${{ runner.arch == 'ARM64' && '3.11.7' || '3.9.14' }}
- name: Finish python setup
if: ${{ runner.os == 'macOS' }}
shell: bash
run: |
python3 -m pip install pip==20.3.4 wheel==0.37.0 --upgrade
- name: Artifact
id: artifact
shell: bash
run: |
python3 CI/run.py --artifacts "${{ inputs.name }}" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: cache
with:
path: ${{ join(fromJSON(steps.artifact.outputs.path), '\n') }}
key: ${{ steps.artifact.outputs.key }}
enableCrossOsArchive: true
- uses: ./.github/actions/mounts
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
with:
name: ${{ inputs.name }}
- name: ${{ inputs.name }}
shell: bash
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
python3 CI/run.py --cache cache --no-recurse --out . "${{ inputs.name }}"
123 changes: 123 additions & 0 deletions .github/workflows/env-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# 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
- run: |
cat <<'EOF'
${{ toJSON(github) }}
EOF
- uses: ./.github/actions/task
with:
name: "docker image: base"

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 }}"

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"

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"

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 }}

mercurial:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest]
version:
- 1.9.3
- 2.5.4
- 3.4.2
- 6.8
include:
- runner: windows-latest
version: 6.8 windows x86_64
- runner: macos-13
version: 6.8 macos x86_64
- runner: macos-14
version: 6.8 macos arm64
runs-on: ${{ matrix.runner }}
needs: [docker, msys]
steps:
- uses: actions/checkout@v4
- run: env
- uses: ./.github/actions/task
with:
name: hg v${{ matrix.version }}

git-cinnabar:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest]
type:
- linux arm64
- linux x86_64
- linux x86_64 asan
- linux x86_64 coverage
- windows x86_64
include:
- runner: macos-13
type: macos x86_64
- runner: macos-14
type: macos arm64
runs-on: ${{ matrix.runner }}
needs: docker
steps:
- uses: actions/checkout@v4
- run: env
- uses: ./.github/actions/task
with:
name: build ${{ matrix.type }}
106 changes: 0 additions & 106 deletions .github/workflows/rust.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/taskcluster.yml

This file was deleted.

Loading

0 comments on commit b4a8dae

Please sign in to comment.