Skip to content

ci: consolidate CI workflows and package with bazel #66

ci: consolidate CI workflows and package with bazel

ci: consolidate CI workflows and package with bazel #66

Workflow file for this run

---
name: CI
on: # yamllint disable rule:truthy
push:
branches:
- master
tags:
- "*.*.*"
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test fetch
run: bazel fetch //...
- name: Test
run: bazel test //...
test-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Test
run: bazel test //...
examples:
runs-on: ubuntu-latest
strategy:
matrix:
example:
- bzlmod
- check_glob
- released_example
steps:
- uses: actions/checkout@v4
- name: Test
run: bazel test //...
working-directory: examples/${{ matrix.example }}
pkg:
runs-on: ubuntu-latest
needs:
- build
- test-mac
- examples
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release archive and notes
run: |
# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
bazel run \
--stamp --embed_label "${{ github.ref_name }}" \
//:release -- release
- name: Archive release artifacts
uses: actions/upload-artifact@v3
with:
name: release
path: release/*
retention-days: 5
release:
runs-on: ubuntu-latest
needs: pkg
steps:
- name: Download release artifacts
uses: actions/download-artifact@v3
with:
name: release
- name: List artifacts for debugging purposes
run: |
ls -1 -R .
- name: Release
if: ${{ github.event_name != 'pull_request' }}
uses: softprops/action-gh-release@v1
with:
# Use GH feature to populate the changelog automatically
generate_release_notes: true
body_path: release/release_notes.md
fail_on_unmatched_files: true
files: release/rules_shellcheck-*.tar.gz