Skip to content

Commit

Permalink
Update the repo, so it builds with modern Bazel and can be worked on
Browse files Browse the repository at this point in the history
* Update Bazel to 7.1.1 and use Bazelisk to launch it
* Update 3rd party Bazel dependencies
* Move to GitHub Actions from Travis
* Update to Scala 3
* Update Scala 3rd party dependencies
* Update Maven publishing to be like our Play Routes Compiler CLI
* Add Bazel formatting and linting with buildifier
  • Loading branch information
James Judd committed Apr 10, 2024
1 parent 65b8675 commit d711b59
Show file tree
Hide file tree
Showing 24 changed files with 2,090 additions and 2,179 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
startup --expand_configs_in_place

common --noenable_bzlmod

common:ci --color=yes

build:ci --verbose_failures
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazelbuild/7.1.1
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI
on:
pull_request:
push:
branches:
- master
tags:
- '*--*'

jobs:
build-and-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
- run: npm install -g @bazel/bazelisk
- run: cat .bazelrc.ci >> .bazelrc
- run: ./scripts/format.sh check
- run: ./test/run_all_tests.sh ci

publish:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: build-and-test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install -g @bazel/bazelisk
- run: cat .bazelrc.ci >> .bazelrc
- name: Parse Tag
run: |
# Tag should be <artifact_id suffix>--<version>
tag=$(awk -F '/' '{print $NF}' <<< $GITHUB_REF)
artifact_id=twirl-compiler-cli_$(awk -F '--' '{print $1}' <<< $tag)
version=$(awk -F '--' '{print $2}' <<< $tag)
echo "COMPILER_CLI_ARTIFACT_ID=$artifact_id" >> $GITHUB_ENV
echo "COMPILER_CLI_VERSION=$version" >> $GITHUB_ENV
- name: Import gpg keys
run: echo "$PGP_SECRET" | base64 --decode | gpg --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Publish to Maven
run: ./scripts/publish.sh
env:
DEPLOY_MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
DEPLOY_MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
9 changes: 0 additions & 9 deletions .mvn_settings.travis.xml

This file was deleted.

44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

Empty file removed BUILD
Empty file.
15 changes: 15 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")

buildifier(
name = "buildifier",
)

buildifier_test(
name = "buildifier_test",
size = "small",
timeout = "short",
lint_mode = "warn",
mode = "check",
no_sandbox = True,
workspace = "//:WORKSPACE",
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# twirl_compiler_cli
Command line interface for the Twirl template compiler

[![Build Status](https://api.travis-ci.com/lucidsoftware/twirl_compiler_cli.svg?branch=master)](https://travis-ci.com/lucidsoftware/twirl_compiler_cli)
[![Build Status](https://github.com/lucidsoftware/twirl_compiler_cli/workflows/CI/badge.svg)](https://github.com/lucidsoftware/twirl_compiler_cli/actions)
Loading

0 comments on commit d711b59

Please sign in to comment.