Skip to content

Commit

Permalink
Merge pull request #4 from worldpeaceio/add-ci
Browse files Browse the repository at this point in the history
Run bazel test and build on PR and main
  • Loading branch information
nateinaction committed May 12, 2021
2 parents b196f34 + f82a787 commit ddb4b42
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 16 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.0
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Summary

## How was this tested?
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
push: {}
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Super-Linter
uses: github/super-linter@v3.17.0

- name: Mount bazel cache
uses: actions/cache@v1
with:
path: "/home/runner/.cache/bazel"
key: bazel

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
- name: Test
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test //...
- name: Build
run: |
"${GITHUB_WORKSPACE}/bin/bazel" build //...
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Bazel env file rules

![Build](https://github.com/worldpeaceio/rules_envfile/actions/workflows/ci.yml/badge.svg?branch=main)

This rule can be used to import environment vars into a Bazel workflow directly from an environment file.

### Basic usage
## Basic usage

In `.env`:
```shell
Expand Down
5 changes: 2 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ load("//:def.bzl", "envfile")
envfile(
name = "env",
files = [
# "non-package/non-package.env",
"//test-package:package.env",
"//test-package:package2.env",
"//test:.env",
"//test:2.env",
]
)
1 change: 0 additions & 1 deletion test-non-package/non-package.env

This file was deleted.

3 changes: 0 additions & 3 deletions test-package/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion test-package/package.env

This file was deleted.

1 change: 0 additions & 1 deletion test-package/package2.env

This file was deleted.

1 change: 1 addition & 0 deletions test/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
QUOTED="foo\nbar"
1 change: 1 addition & 0 deletions test/2.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UNQUOTED=baz
8 changes: 2 additions & 6 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

if [ "${QUOTED}" != "foo" ]; then
if [ "${QUOTED}" != "foo
bar" ]; then
echo "QUOTED not set"
exit 1
fi
Expand All @@ -9,8 +10,3 @@ if [ "${UNQUOTED}" != "baz" ]; then
echo "UNQUOTED not set"
exit 1
fi

# if [ "${NON_PACKAGE}" != "bar" ]; then
# echo "NON_PACKAGE not set"
# exit 1
# fi

0 comments on commit ddb4b42

Please sign in to comment.