Skip to content

gh actions for lint and template tests #1

gh actions for lint and template tests

gh actions for lint and template tests #1

Workflow file for this run

name: lint-and-template-tests
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
branches:
- develop
paths:
- 'src/**'
- 'packages/**'
- 'jobs/**'
- 'config/**'
- 'scripts/**'
- '.github/workflows/**'
- '.github/helpers/**'
env:
RUN_AS: root
jobs:
repo-clone:
runs-on: ubuntu-latest
steps:
- name: nats-release-repo
uses: actions/checkout@v4.3.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
submodules: recursive
path: repo
- name: Check out wg-appruntime code
uses: actions/checkout@v4.3.1
with:
repository: cloudfoundry/wg-app-platform-runtime-ci
path: ci
- name: zip repo artifacts
run: |
tar -czf repo-artifact.tar.gz repo
tar -czf ci-artifact.tar.gz ci
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: repo
path: |
repo-artifact.tar.gz
ci-artifact.tar.gz
template-tests:
runs-on: ubuntu-latest
needs: [repo-clone]
container: cloudfoundry/tas-runtime-build:latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: template-tests
run: |
# Executes the same template test task as the Concourse pipeline
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-tests-templates/task.bash
lint-repo:
runs-on: ubuntu-latest
needs: [repo-clone]
container: cloudfoundry/tas-runtime-build:latest
env:
LINTERS: |
sync-package-specs.bash
sync-submodule-config.bash
match-golang-os-package-versions.bash
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: repo
- run: |
tar -xzvf repo-artifact.tar.gz
tar -xzvf ci-artifact.tar.gz
- name: lint-repo
run: |
# Executes the nats-release specific linters (sync-package-specs.bash)
"${GITHUB_WORKSPACE}"/ci/shared/tasks/lint-repo/task.bash