Skip to content

Commit

Permalink
Init 2024 Gleam
Browse files Browse the repository at this point in the history
  • Loading branch information
dalanmiller committed Dec 1, 2024
1 parent 2a2dd9d commit cf39fec
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/gleam2024.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 2024 Gleam Tests

on:
push:
paths:
- "2024/**/*"

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Gleam
run: |
curl -fSsL https://gleam.run/install.sh | sh
export PATH=$HOME/.gleam/bin:$PATH
- name: Verify Gleam Installation
run: gleam --version

- name: Run Gleam tests
working-directory: ./2024
run: gleam test
23 changes: 23 additions & 0 deletions 2024/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test

on:
push:
branches:
- master
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: "27.1.2"
gleam-version: "1.6.2"
rebar3-version: "3"
# elixir-version: "1.15.4"
- run: gleam deps download
- run: gleam test
- run: gleam format --check src test
4 changes: 4 additions & 0 deletions 2024/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.beam
*.ez
/build
erl_crash.dump
24 changes: 24 additions & 0 deletions 2024/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# aoc_2024

[![Package Version](https://img.shields.io/hexpm/v/aoc_2024)](https://hex.pm/packages/aoc_2024)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/aoc_2024/)

```sh
gleam add aoc_2024@1
```
```gleam
import aoc_2024
pub fn main() {
// TODO: An example of the project in use
}
```

Further documentation can be found at <https://hexdocs.pm/aoc_2024>.

## Development

```sh
gleam run # Run the project
gleam test # Run the tests
```
22 changes: 22 additions & 0 deletions 2024/gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name = "aoc_2024"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "", repo = "" }
# links = [{ title = "Website", href = "" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
gleam_stdlib = ">= 0.34.0 and < 2.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"

[javascript]
runtime="bun"
11 changes: 11 additions & 0 deletions 2024/manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
{ name = "gleam_stdlib", version = "0.45.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "206FCE1A76974AECFC55AEBCD0217D59EDE4E408C016E2CFCCC8FF51278F186E" },
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
]

[requirements]
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
5 changes: 5 additions & 0 deletions 2024/src/aoc_2024.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import gleam/io

pub fn main() {
io.println("Hello from aoc_2024!")
}
12 changes: 12 additions & 0 deletions 2024/test/aoc_2024_test.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import gleeunit
import gleeunit/should

pub fn main() {
gleeunit.main()
}

// gleeunit test functions end in `_test`
pub fn hello_world_test() {
1
|> should.equal(1)
}

0 comments on commit cf39fec

Please sign in to comment.