Skip to content

Commit

Permalink
project revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdbd committed Oct 6, 2024
1 parent 1603346 commit 81c1949
Show file tree
Hide file tree
Showing 31 changed files with 1,010 additions and 709 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 'CI/CD'

on:
pull_request:
push:
branches:
- canary
- main

env:
APP_ID: fosdem-dl
APP_VERSION: 0.1.0-RC.1
GRAALVM_VERSION: 23.0.0
HEAP_SIZE_AT_BUILD_TIME: '-R:MaxHeapSize=1024m'
JAVA_VERSION: 21
OPTIMIZATION_LEVEL: '-O2'

jobs:
linux:
name: Build (Linux)
runs-on: ubuntu-latest

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4

- name: 🔧 Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
check-for-updates: true
distribution: graalvm-community
java-version: ${{ env.JAVA_VERSION }}
native-image-job-reports: true
native-image-pr-reports: true
version: ${{ env.GRAALVM_VERSION }}

- name: 🔧 Setup Babashka
uses: DeLaGuardo/[email protected]
with:
bb: 'latest'

- name: ⬇️ Download com.github.jackdbd/pod-jackdbd-jsoup
run: ./download_pod_jackdbd_jsoup.sh

- name: 🔍 Run all tests
run: bb test_runner.clj

# https://github.com/liquidz/babashka-test-action/
- name: Run babashka-test-action
uses: liquidz/babashka-test-action@v1
with:
source-paths: 'src'
test-paths: 'test'
test-file-pattern: '_test.clj$'

- name: 📦 Compile uberjar to x86_64-linux binary with GraalVM native-image
run: ./script/compile.sh

macos:
name: Build (macOS)
runs-on: macos-latest

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4

- name: 🔧 Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
check-for-updates: true
distribution: graalvm-community
java-version: ${{ env.JAVA_VERSION }}
native-image-job-reports: true
native-image-pr-reports: true
version: ${{ env.GRAALVM_VERSION }}

- name: 📦 Compile uberjar to AArch64-macOS binary with GraalVM native-image
run: |
native-image \
-jar ${{ env.APP_ID }}-${{ env.APP_VERSION }}-standalone.jar \
'-H:ReflectionConfigurationFiles=reflection.json' \
'-H:+ReportExceptionStackTraces' \
'-J-Dclojure.compiler.direct-linking=true' \
${{ env.HEAP_SIZE_AT_BUILD_TIME }} \
${{ env.OPTIMIZATION_LEVEL }} \
'-march=armv8-a' \
'--initialize-at-build-time' \
'--native-image-info' \
'--no-fallback' \
'--report-unsupported-elements-at-runtime'
23 changes: 0 additions & 23 deletions .github/workflows/ci.yml

This file was deleted.

35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
# fosdem-dl (FOSDEM talks downloder)

![CI/CD](https://github.com/jackdbd/fosdem-dl/actions/workflows/ci-cd.yaml/badge.svg)

[babashka](https://github.com/babashka/babashka) script to download talks and attachments from the 2003-2020 [FOSDEM](https://fosdem.org/2021/) websites.

## Usage
![Dependency graph of all the namespaces](./resources/img/namespaces.png)

### Parameters
## Usage

```text
-y, --year YEAR Select year (default 2020)
-t, --track TRACK Select conference track (e.g. web_performance)
-f, --format FORMAT Select video format (default webm)
-a, --attachments Download each talk's attachments like PDFs and slides (default false)
-h, --help Show help
```sh
fosdem-dl talks --help
fosdem-dl tracks --help
```

### Examples
## Examples

Download all the 2018 talks from the python track in .webm format; include no attachments.
Download all talks from the python track of FOSDEM 2018, in .webm format, with no attachments.

```sh
./fosdem-dl.sh -y 2018 -t python
fosdem-dl talks -y 2018 -t python
```

Download all the 2020 talks from the web performance track in .mp4 format; include all attachments.
Download all talks of the web performance track from FOSDEM 2020, in .mp4 format, with all attachments.

```sh
./fosdem-dl.sh -y 2020 -t web_performance -f mp4 -a
fosdem-dl -y 2020 -t web_performance -f mp4 -a
```

## Build

In order to use this script you need to generate a GraalVM native image of the [pod-jaydeesimon-jsoup](https://github.com/jaydeesimon/pod-jaydeesimon-jsoup) babashka pod and place it in this project's root. This is necessary because pod-jaydeesimon-jsoup is not yet published on the [Pod registry](https://github.com/babashka/pod-registry).

## Tests

Run all tests with:
Run all tests with either one of the following commands:

```sh
./test-runner.clj
./test_runner.clj
bb test
```

## TODO
Expand All @@ -50,7 +46,6 @@ Run all tests with:
- Fix Babashka pods on NixOS or find alternative solutions.
- Improve error handling.
- Add more tests.
- How do I run `.github/workflows/ci.yml` when the pod-jaydeesimon-jsoup binary is not tracked in git?
- Save edn file with all conference tracks over the years (to validate the `--track` option for a given `--year`).
- Accept destination directory to let the user decide where to download the files.
- Include the talk's links too? Maybe write them in a text/markdown file?
Expand Down
Loading

0 comments on commit 81c1949

Please sign in to comment.