Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 30, 2024
0 parents commit 2b6381e
Show file tree
Hide file tree
Showing 163 changed files with 13,332 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"image": "mcr.microsoft.com/devcontainers/base:alpine",
"features": {
"ghcr.io/devcontainers/features/nix:1": {
"extraNixConfig": "experimental-features = nix-command flakes"
}
},
"onCreateCommand": "nix shell nixpkgs#gitMinimal -c nix run nixpkgs#home-manager -- switch --flake git+https://code.europa.eu/ecphp/devs-profile#light --impure",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "fish"
}
}
}
}
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.{tex,cls,lua,nix,typ,md}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2
max_line_length = 80
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake .
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @drupol
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
55 changes: 55 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# https://github.com/probot/settings

branches:
- name: main
protection:
enforce_admins: false
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: true
required_approving_review_count: 1
restrictions: null
required_linear_history: true
- name: update_flake_lock_action
protection:
enforce_admins: false
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: false
restrictions: null
required_linear_history: true

labels:
- name: bug
color: ee0701

- name: dependencies
color: 0366d6

- name: enhancement
color: 0e8a16

- name: question
color: cc317c

- name: security
color: ee0701

- name: stale
color: eeeeee

repository:
allow_merge_commit: true
allow_rebase_merge: true
allow_squash_merge: true
default_branch: main
description: "Pol Dellaiera's Master Thesis - Reproducibility In Software Engineering"
homepage: https://github.com/drupol/master-thesis
topics: master-thesis,umons
has_downloads: true
has_issues: true
has_pages: false
has_projects: false
has_wiki: false
name: master-thesis
private: true
84 changes: 84 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release

on:
push:
branches:
- main
paths:
- "src/**"
- "resources/**"
- "**.nix"
- ".github/workflows/*.yml"

jobs:
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}

steps:
- name: Check out source files
uses: actions/checkout@v4

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

build:
name: Build PDF files
runs-on: ubuntu-latest
needs: [dependencies]

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out source files
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Build document
run: |
mkdir -p output
nix build .#thesis --out-link result-thesis --quiet
cp -vr --dereference $(readlink -f result-thesis) thesis
cp -ar thesis/* output/
- name: Upload build assets
uses: actions/upload-artifact@v4
with:
name: artefacts
path: output

assets:
name: Create release
runs-on: ubuntu-latest
needs: [dependencies, build]

steps:
- name: Download build assets (${{ matrix.assets.input }})
uses: actions/download-artifact@v4

- name: Rename files
working-directory: artefacts
run: |
for f in *.pdf; do cp ${f} ../$(printf '%s\n' "${{ github.run_number }}--${f%.pdf}--${{ github.sha }}.pdf"); done
- name: Create pre-release (v${{ github.run_number }}-${{ github.sha }})
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}-${{ github.sha }}
name: Release ${{ github.run_number }} (${{ github.sha }})
draft: false
prerelease: true
files: |
./*.pdf
46 changes: 46 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build PR

on:
push:

jobs:
build:
name: Build PDF files
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out source files
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Build document
run: |
nix build .#thesis --out-link result-thesis --quiet
cp -vr --dereference $(readlink -f result-thesis) thesis
mkdir -p artefacts
cp -ar thesis/* artefacts/
- name: Rename files
working-directory: artefacts
run: |
for f in *.pdf; do mv ${f} $(printf '%s\n' "${{ github.run_number }}--${f%.pdf}--${{ github.sha }}.pdf"); done
- name: Upload build assets
uses: actions/upload-artifact@v4
with:
name: pdf--branch-${{ steps.extract_branch.outputs.branch }}--${{ github.sha }}
path: artefacts
if-no-files-found: error
78 changes: 78 additions & 0 deletions .github/workflows/comment-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: Comment Artifact URL on PR

on:
workflow_run:
types:
- "completed"
workflows:
- "Build PR"

jobs:
comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Get Artifact and Pull request info
env:
GITHUB_TOKEN: ${{ github.token }}
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
run: |
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Job ID: $PREVIOUS_JOB_ID"
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
SUITE_ID=$(jq -r '.check_suite_id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Suite ID: $SUITE_ID"
echo "SUITE_ID=$SUITE_ID" >> "$GITHUB_ENV"
ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.id")
echo "Artifact ID: $ARTIFACT_ID"
echo "ARTIFACT_ID=$ARTIFACT_ID" >> "$GITHUB_ENV"
PR_NUMBER=$(jq -r '.pull_requests[0].number' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Pull request Number: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Head SHA: $HEAD_SHA"
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
- name: Find Comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ env.PR_NUMBER }}
comment-author: "github-actions[bot]"
- name: Update Comment
env:
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}"
ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.ARTIFACT_ID }}"
HEAD_SHA: "${{ env.HEAD_SHA }}"
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ env.PR_NUMBER }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: |-
![badge]
Build Successful! You can find a link to the downloadable artifact below.
| Name | Link |
| -------- | ----------------------- |
| Commit | ${{ env.HEAD_SHA }} |
| Logs | ${{ env.JOB_PATH }} |
| Download | ${{ env.ARTIFACT_URL }} |
[badge]: https://img.shields.io/badge/Build_Success!-0d1117?style=for-the-badge&labelColor=3fb950&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMjEuMDMgNS43MmEuNzUuNzUgMCAwIDEgMCAxLjA2bC0xMS41IDExLjVhLjc0Ny43NDcgMCAwIDEtMS4wNzItLjAxMmwtNS41LTUuNzVhLjc1Ljc1IDAgMSAxIDEuMDg0LTEuMDM2bDQuOTcgNS4xOTVMMTkuOTcgNS43MmEuNzUuNzUgMCAwIDEgMS4wNiAwWiI+PC9wYXRoPjwvc3ZnPg==
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/.cache/
/.devenv/
/.direnv/
/build/
/.vscode/
/out/
*.bak*
indent.log
/result
/*.pdf
/*.pdfpc
/src/**/*.pdf
lib/**/output
lib/**/result
lib/**/*.pdf
/trunk/
cert.pem
private-key.pem
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.direnv/
/.idea/
/vendor/
/docs/
/build/
CHANGELOG.md
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"proseWrap": "always"
}
Loading

0 comments on commit 2b6381e

Please sign in to comment.