Skip to content

Commit

Permalink
cleanup 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bwireman committed Dec 31, 2024
1 parent 58dc32c commit aa3f48c
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 76 deletions.
139 changes: 70 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,29 @@ env:
nodelts: 22.x

jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: erlef/setup-beam@v1
# with:
# otp-version: ${{ env.otp }}
# gleam-version: ${{ env.gleam }}
# rebar3-version: ${{ env.rebar }}
# - run: gleam format --check src test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp }}
gleam-version: ${{ env.gleam }}
rebar3-version: ${{ env.rebar }}
- run: gleam format --check src test

erlang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp }}
gleam-version: ${{ env.gleam }}
rebar3-version: ${{ env.rebar }}
- run: gleam test --target erlang
- run: gleam run --target erlang -- --outdated

# erlang:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: erlef/setup-beam@v1
# with:
# otp-version: ${{ env.otp }}
# gleam-version: ${{ env.gleam }}
# rebar3-version: ${{ env.rebar }}
# - run: gleam test --target erlang
# - run: gleam run --target erlang -- --outdated
windows:
runs-on: windows-latest
steps:
Expand All @@ -46,53 +47,53 @@ jobs:
rebar3-version: ${{ env.rebar }}
- run: gleam run --target erlang -- --outdated

# node:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [20.x, 22.x, 23.x]
# steps:
# - uses: actions/checkout@v4
# - uses: erlef/setup-beam@v1
# with:
# otp-version: ${{ env.otp }}
# gleam-version: ${{ env.gleam }}
# rebar3-version: ${{ env.rebar }}
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# cache: "npm"
# - run: yarn install
# - run: gleam test --target javascript --runtime nodejs
# - run: gleam run --target javascript --runtime nodejs -- --outdated
node:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 23.x]
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp }}
gleam-version: ${{ env.gleam }}
rebar3-version: ${{ env.rebar }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: yarn install
- run: gleam test --target javascript --runtime nodejs
- run: gleam run --target javascript --runtime nodejs -- --outdated

# bun:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: erlef/setup-beam@v1
# with:
# otp-version: ${{ env.otp }}
# gleam-version: ${{ env.gleam }}
# rebar3-version: ${{ env.rebar }}
# - uses: oven-sh/setup-bun@v1
# - run: bun install
# - run: gleam test --target javascript --runtime bun
# - run: gleam run --target javascript --runtime bun -- --outdated
bun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp }}
gleam-version: ${{ env.gleam }}
rebar3-version: ${{ env.rebar }}
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: gleam test --target javascript --runtime bun
- run: gleam run --target javascript --runtime bun -- --outdated

# deno:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: erlef/setup-beam@v1
# with:
# otp-version: ${{ env.otp }}
# gleam-version: ${{ env.gleam }}
# rebar3-version: ${{ env.rebar }}
# - uses: denoland/setup-deno@v1
# with:
# deno-version: v2.x # Run with latest stable Deno.
# - run: deno install
# - run: gleam test --target javascript --runtime deno
# - run: gleam run --target javascript --runtime deno -- --outdated
deno:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp }}
gleam-version: ${{ env.gleam }}
rebar3-version: ${{ env.rebar }}
- uses: denoland/setup-deno@v1
with:
deno-version: v2.x # Run with latest stable Deno.
- run: deno install
- run: gleam test --target javascript --runtime deno
- run: gleam run --target javascript --runtime deno -- --outdated
8 changes: 4 additions & 4 deletions src/go_over/packages.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ pub type Package {
}

pub fn read_manifest(path: String) -> List(Package) {
let res =
let manifest =
simplifile.read(path)
|> hard_fail("could not parse " <> path)
let cleaned = string.replace(res, "\r\n", "\n")

let manifest = tom.parse(cleaned) |> hard_fail("could not parse " <> path)
|> string.replace("\r\n", "\n")
|> tom.parse()
|> hard_fail("could not parse " <> path)

let packages =
tom.get_array(manifest, ["packages"])
Expand Down
3 changes: 3 additions & 0 deletions test/testdata/manifest/a.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
{ name = "a", version = "0.8.1", build_tools = ["gleam"], requirements = [], otp_app = "a", source = "hex", outer_checksum = "976CFF85D34D50F7775896615A71745FBE0C325E50399787088F941B539A0497" },
]
Expand Down
3 changes: 3 additions & 0 deletions test/testdata/manifest/empty.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
]

Expand Down
3 changes: 3 additions & 0 deletions test/testdata/manifest/known_vulnerable.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file was generated by Gleam
# You typically do not need to edit this file

packages = [
{ name = "safe", version = "0.8.1", build_tools = ["gleam"], requirements = [], otp_app = "safe", source = "hex", outer_checksum = "976CFF85D34D50F7775896615A71745FBE0C325E50399787088F941B539A0497" },
{ name = "phoenix", version = "1.2.0", build_tools = ["gleam"], requirements = ["safe"], otp_app = "hex_core", source = "hex", outer_checksum = "976CFF85D34D50F7775896615A71745FBE0C325E50399787088F941B539A0497" },
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@


yaml@^2.5.0:
version "2.6.1"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.6.1.tgz#42f2b1ba89203f374609572d5349fb8686500773"
integrity sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==
version "2.7.0"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98"
integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==

0 comments on commit aa3f48c

Please sign in to comment.