Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STUD-5585: Migrate to GHA #12

Merged
merged 5 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Only allow Workiva employees to alter GHA workflows
/.github/ @Workiva/cloud42
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: flip-tables CI

on:
pull_request:
branches: [ '*' ]
push:
branches: [ 'master' ]
tags: [ '*' ]

permissions:
contents: read
id-token: write

jobs:
gradle-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '8'
- uses: gradle/actions/setup-gradle@v3

- name: Build Release Version
if: ${{ github.ref_type == 'tag' }}
run: ./gradlew clean assemble --info -Dorg.gradle.project.version=${{ github.ref_name }}

- name: Build Non-Release Version
if: ${{ github.ref_type != 'tag' }}
run: ./gradlew clean assemble --info

- name: Bundle/TAR up JAR files
run: |
tar -cvzf ./build/libs/java.tar.gz ./build/libs/*.jar
ls -ls ./build/libs

- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: flip-tables
path: ./build/libs/flip-tables-*.*.jar

- name: Publish Snapshot
if: ${{ github.ref_type != 'tag' && github.ref_name != 'master' && hashFiles('./build/libs/*-SNAPSHOT.jar') != '' }}
uses: actions/upload-artifact@v4
with:
name: flip-tables-snapshot
path: ./build/libs/*-SNAPSHOT.jar

Unit-Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '8'
- uses: gradle/actions/setup-gradle@v3

- name: Run Tests
run: ./gradlew --no-daemon --console=plain test
26 changes: 26 additions & 0 deletions .github/workflows/publish-sbom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish SBOM

on:
push:
tags:
# Releases
- '[0-9]+.[0-9]+.[0-9]+'

# Permissions should look like this
permissions:
contents: write
id-token: write
pull-requests: write

jobs:
create-sbom-release-asset:
name: Create SBOM Release Asset
runs-on: ubuntu-latest
steps:
# If you don't check the code out, the SBOM will be empty
- uses: actions/checkout@v4
- name: Publish SBOM to Release Assets
uses: anchore/sbom-action@v0
with:
path: ./ # actions/checkout default location
format: cyclonedx-json
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

24 changes: 0 additions & 24 deletions skynet.yaml

This file was deleted.