Skip to content

Commit

Permalink
Merge branch 'devel' into rework-the-c-code-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
zerbina committed Jul 25, 2024
2 parents 8fde6c1 + d36b9a3 commit 9d4d5b2
Show file tree
Hide file tree
Showing 89 changed files with 3,407 additions and 1,348 deletions.
5 changes: 2 additions & 3 deletions .github/actions/setup-mingw/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:

- name: Download from niXman/mingw-builds-binaries
id: download
uses: robinraju/release-downloader@v1.8
uses: robinraju/release-downloader@v1.10
with:
repository: niXman/mingw-builds-binaries
tag: ${{ inputs.mingw-version }}
Expand All @@ -31,8 +31,7 @@ runs:
Join-Path $env:RUNNER_TEMP "mingw64" "bin" | Out-File -Append $env:GITHUB_PATH
shell: pwsh
env:
MINGW_ARCHIVE:
${{ fromJson(steps.download.outputs.downloaded_files)[0] }}
MINGW_ARCHIVE: ${{ fromJson(steps.download.outputs.downloaded_files)[0] }}
working-directory: ${{ runner.temp }}

- name: Print GCC version
Expand Down
62 changes: 62 additions & 0 deletions .github/actions/setup-vcpkg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Setup vcpkg
description: Clone and setup vcpkg
inputs:
triplet:
description: Specify the target triplet
required: false
host-triplet:
description: Specify the host triplet
required: false
overlay-triplets:
description: Additional directories to search to triplets, one entry per line
required: false
revision:
description: The revision of the vcpkg registry to be used
required: false

runs:
using: composite

steps:
- name: Clone vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
ref: ${{ inputs.revision }}
filter: tree:0
path: vcpkg

- name: Setup environment variables
uses: actions/github-script@v7
with:
script: |
// Configuration for GitHub Actions cache
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
// vcpkg configuration
const path = require('node:path');
const vcpkg_root = path.join(process.env.GITHUB_WORKSPACE, 'vcpkg');
core.exportVariable('VCPKG_ROOT', vcpkg_root);
core.addPath(vcpkg_root);
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite');
const triplet = process.env.AINPUT_TRIPLET;
if (triplet) {
core.exportVariable('VCPKG_DEFAULT_TRIPLET', triplet);
}
const hostTriplet = process.env.AINPUT_HOST_TRIPLET;
if (hostTriplet) {
core.exportVariable('VCPKG_DEFAULT_HOST_TRIPLET', hostTriplet);
}
const tripletOverlays = process.env.AINPUT_OVERLAY_TRIPLETS?.replace(/\n/, path.delimiter);
if (tripletOverlays) {
core.exportVariable('VCPKG_OVERLAY_TRIPLETS', tripletOverlays);
}
env:
AINPUT_TRIPLET: ${{ inputs.triplet }}
AINPUT_HOST_TRIPLET: ${{ inputs.host-triplet }}
AINPUT_OVERLAY_TRIPLETS: ${{ inputs.overlay-triplets }}

- run: ./vcpkg/bootstrap-vcpkg.sh
shell: bash
94 changes: 94 additions & 0 deletions .github/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["enhancement"],
"categories": [
{
"title": "### Compiler",
"labels": ["enhancement"],
"exhaustive": true,
"rules": [
{
"on_property": "labels",
"pattern": "compiler.*"
}
]
},
{
"title": "### Standard Library",
"labels": ["enhancement", "stdlib"],
"exhaustive": true
},
{
"title": "### Tooling",
"labels": ["enhancement", "tools"],
"exhaustive": true
}
]
},
{
"title": "## 🐛 Fixes",
"labels": ["bug"],
"categories": [
{
"title": "### Compiler",
"labels": ["bug"],
"exhaustive": true,
"rules": [
{
"on_property": "labels",
"pattern": "compiler.*"
}
]
},
{
"title": "### Standard Library",
"labels": ["bug", "stdlib"],
"exhaustive": true
},
{
"title": "### Tooling",
"labels": ["bug", "tool"],
"exhaustive": true
}
]
},
{
"title": "## 🔧 Refactorings",
"labels": ["refactor", "simplification"],
"categories": [
{
"title": "### Compiler",
"labels": ["refactor", "simplification"],
"exhaustive_rules": true,
"rules": [
{
"on_property": "labels",
"pattern": "compiler.*"
}
]
},
{
"title": "### Standard Library",
"labels": ["refactor", "stdlib"],
"exhaustive": true
},
{
"title": "### Tooling",
"labels": ["refactor", "tool"],
"exhaustive": true
}
]
},
{
"title": "## 💬 Other",
"labels": []
}
],
"template": "# What's Changed\n\n#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}",
"empty_template": "**Full Changelog**: #{{RELEASE_DIFF}}",
"pr_template": "* #{{TITLE}} by @#{{AUTHOR}} in #{{URL}}",
"sort": "DSC",
"base_branches": ["devel"]
}
75 changes: 30 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ defaults:
run:
shell: bash

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
pre_run:
name: Provide additional context for the workflow
Expand All @@ -42,29 +46,17 @@ jobs:
shared_builder: ${{ steps.matrix.outputs.shared }}

steps:
- id: run_cond
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
# Cancel CI on outdated commits
cancel_others: true
# Don't skip when a duplicated run (ie. from a PR) is done.
#
# Only CI in upstream has docs publishing rights.
skip_after_successful_duplicate: false
# Do not skip on push, dispatched or cron
do_not_skip: '["push", "workflow_dispatch", "schedule"]'

- id: skip_result
name: Whether to skip checks
run: |
if [[ '${{ steps.run_cond.outputs.should_skip }}' == true ]]; then
echo "result=true" >> $GITHUB_OUTPUT
elif [[ '${{ github.event.pull_request.draft }}' == true ]]; then
if [[ $IS_DRAFT == true ]]; then
echo "Pull request is in draft state, skipping"
echo "result=true" >> $GITHUB_OUTPUT
else
echo "result=false" >> $GITHUB_OUTPUT
fi
env:
IS_DRAFT: ${{ github.event.pull_request.draft }}

- id: matrix
name: Obtain build target matrix
Expand Down Expand Up @@ -135,18 +127,18 @@ jobs:
if: runner.os == 'Windows'
uses: ./.github/actions/setup-mingw

- name: Install dependencies (Windows)
- name: Setup vcpkg (Windows)
if: runner.os == 'Windows'
uses: johnwason/vcpkg-action@v6
uses: ./.github/actions/setup-vcpkg
with:
pkgs: >-
pcre
sqlite3
triplet: x64-mingw-dynamic-release
extra-args: --overlay-triplets=${{ github.workspace }}/tools/vcpkg/triplets --host-triplet=x64-mingw-dynamic-release
host-triplet: x64-mingw-dynamic-release
revision: 2024.01.12
github-binarycache: true
token: ${{ github.token }}
overlay-triplets: ${{ github.workspace }}/tools/vcpkg/triplets

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: vcpkg install pcre sqlite3

- name: Download CA certificates (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -248,7 +240,9 @@ jobs:
shell: pwsh

- name: Run tester
run: ./koch.py test --batch:'${{ matrix.batch }}_${{ matrix.total_batch }}' --tryFailing all
run: ./koch.py test --batch:"$TEST_BATCH" --tryFailing all
env:
TEST_BATCH: ${{ matrix.batch }}_${{ matrix.total_batch }}

- name: Print all test errors
if: failure()
Expand Down Expand Up @@ -393,18 +387,18 @@ jobs:
# Pipe from zstd to tar because macOS' tar does not support unpacking zstd
zstd -c -d "$archive" | tar -xf - --strip-components 1
- name: Install dependencies (Windows)
- name: Setup vcpkg (Windows)
if: runner.os == 'Windows'
uses: johnwason/vcpkg-action@v6
uses: ./git-src/.github/actions/setup-vcpkg
with:
pkgs: >-
pcre
sqlite3
triplet: x64-mingw-dynamic-release
extra-args: --overlay-triplets=${{ github.workspace }}/tools/vcpkg/triplets --host-triplet=x64-mingw-dynamic-release
host-triplet: x64-mingw-dynamic-release
revision: 2024.01.12
github-binarycache: true
token: ${{ github.token }}
overlay-triplets: ${{ github.workspace }}/tools/vcpkg/triplets

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: vcpkg install pcre sqlite3

- name: Add DLLs to PATH (Windows)
if: runner.os == 'Windows'
Expand All @@ -428,8 +422,8 @@ jobs:
- name: Build docs
run: |
./koch.py doc \
--git.url:'https://github.com/${{ github.repository }}' \
--git.commit:'${{ github.sha }}' \
--git.url:"https://github.com/$GITHUB_REPOSITORY" \
--git.commit:"$GITHUB_SHA" \
--git.devel:devel
# Remove leftover nimskullcache
Expand Down Expand Up @@ -522,8 +516,8 @@ jobs:
- name: Build docs
run: |
./koch.py doc \
--git.url:'https://github.com/${{ github.repository }}' \
--git.commit:'${{ github.sha }}' \
--git.url:"https://github.com/$GITHUB_REPOSITORY" \
--git.commit:"$GITHUB_SHA" \
--git.devel:devel
# Remove leftover nimskullcache
Expand All @@ -549,15 +543,6 @@ jobs:
echo "archive=$archive" >> $GITHUB_OUTPUT
echo "metadata=$metadata" >> $GITHUB_OUTPUT
- name: Upload docs to artifacts
if: matrix.target.shared_builder
uses: actions/upload-artifact@v4
with:
# If this name is updated, tweak publisher.yml
name: Generated docs
path: doc/html/
if-no-files-found: error

- name: Upload release package to artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
Loading

0 comments on commit 9d4d5b2

Please sign in to comment.