From 7bc13ec66bc61b8ab83e3dcd1432d1ac253b5ca0 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Wed, 18 Jan 2023 20:55:27 -0500 Subject: [PATCH] Consolidate CI workflows, fix test --- .github/workflows/build.yaml | 23 --------------------- .github/workflows/{lint.yaml => ci.yaml} | 12 ++++++++--- .github/workflows/test.yaml | 23 --------------------- scripts/hello_lune.luau | 26 ++++++++++++++---------- 4 files changed, 24 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/build.yaml rename .github/workflows/{lint.yaml => ci.yaml} (74%) delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 02c62e2..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -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 diff --git a/.github/workflows/lint.yaml b/.github/workflows/ci.yaml similarity index 74% rename from .github/workflows/lint.yaml rename to .github/workflows/ci.yaml index 8f4d480..7812f68 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/ci.yaml @@ -1,11 +1,11 @@ -name: Lint +name: CI on: push: jobs: - lint: - name: Lint + ci: + name: CI runs-on: ubuntu-latest steps: @@ -22,5 +22,11 @@ jobs: - name: Rustfmt run: cargo fmt -- --check + - name: Build + run: cargo build --locked --verbose + - name: Clippy run: cargo clippy + + - name: Test + run: cargo test diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 943cbbe..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -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 diff --git a/scripts/hello_lune.luau b/scripts/hello_lune.luau index 5a64e36..817eefb 100644 --- a/scripts/hello_lune.luau +++ b/scripts/hello_lune.luau @@ -53,19 +53,23 @@ for _, key in vars do print(string.format("[%s] %s", box, key)) 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...") -local result = process.spawn("ping", { - "google.com", - "-c 4", -}) +if process.getEnvVar("GITHUB_ACTIONS") == nil then + print("\nSending 4 pings to google...") + local result = process.spawn("ping", { + "google.com", + "-c 4", + }) -if result.ok then - print(result.stdout) -else - print(result.stderr) - process.exit(result.code) + if result.ok then + print(result.stdout) + else + print(result.stderr) + process.exit(result.code) + end end print("\nGoodbye, lune! 🌙")