Consolidate CI workflows, fix test

This commit is contained in:
Filip Tibell 2023-01-18 20:55:27 -05:00
parent 8078425b2d
commit 7bc13ec66b
No known key found for this signature in database
4 changed files with 24 additions and 60 deletions

View file

@ -1,23 +0,0 @@
name: Build
on:
push:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Build
run: cargo build --locked --verbose

View file

@ -1,11 +1,11 @@
name: Lint name: CI
on: on:
push: push:
jobs: jobs:
lint: ci:
name: Lint name: CI
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -22,5 +22,11 @@ jobs:
- name: Rustfmt - name: Rustfmt
run: cargo fmt -- --check run: cargo fmt -- --check
- name: Build
run: cargo build --locked --verbose
- name: Clippy - name: Clippy
run: cargo clippy run: cargo clippy
- name: Test
run: cargo test

View file

@ -1,23 +0,0 @@
name: Test
on:
push:
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Test
run: cargo test

View file

@ -53,19 +53,23 @@ for _, key in vars do
print(string.format("[%s] %s", box, key)) print(string.format("[%s] %s", box, key))
end end
-- Call out to another program -- Call out to another program / executable
-- NOTE: We don't do this in GitHub Actions and
-- our test suite since ping does not work there
print("\nSending 4 pings to google...") if process.getEnvVar("GITHUB_ACTIONS") == nil then
local result = process.spawn("ping", { print("\nSending 4 pings to google...")
local result = process.spawn("ping", {
"google.com", "google.com",
"-c 4", "-c 4",
}) })
if result.ok then if result.ok then
print(result.stdout) print(result.stdout)
else else
print(result.stderr) print(result.stderr)
process.exit(result.code) process.exit(result.code)
end
end end
print("\nGoodbye, lune! 🌙") print("\nGoodbye, lune! 🌙")