Rewrite docker/ add git-patch output #325
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [linux] | |
include: | |
- os: linux | |
runner: ubuntu-latest | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: stack | |
uses: freckle/stack-action@v5 | |
# - uses: freckle/weeder-action@v2 | |
# with: | |
# ghc-version: ${{ steps.stack.outputs.compiler-version }} | |
- run: | | |
dist=restyler-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m) | |
mkdir -p "$dist" | |
cp -v ${{ steps.stack.outputs.local-install-root }}/bin/* "$dist" | |
tar czf "$dist.tar.gz" "$dist" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }}-binaries | |
path: "restyler-*.tar.gz" | |
if-no-files-found: error | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/hlint-setup@v2 | |
- uses: haskell-actions/hlint-run@v2 | |
with: | |
fail-on: warning | |
image: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Skipping this for now" | |
# - id: meta | |
# uses: docker/metadata-action@v5 | |
# with: | |
# images: restyled/restyler | |
# tags: | | |
# type=sha,prefix=,priority=1000 | |
# type=edge,branch=main | |
# type=ref,event=tag | |
# - uses: docker/setup-buildx-action@v3 | |
# - uses: docker/login-action@v3 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
# - uses: docker/build-push-action@v5 | |
# with: | |
# cache-from: type=gha | |
# cache-to: type=gha,mode=max | |
# push: ${{ github.event_name != 'pull_request' }} | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} | |
outputs: | |
tags: ${{ steps.meta.outputs.tags }} | |
release: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- id: tag | |
uses: freckle/haskell-tag-action@v1 | |
- if: steps.tag.outputs.tag | |
uses: actions/download-artifact@v4 | |
- if: steps.tag.outputs.tag | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.tag.outputs.tag }} | |
generate_release_notes: true | |
files: "*-binaries/restyler-*.tar.gz" | |
fail_on_unmatched_files: true | |
test-install: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ./install | |
- run: restyle --help | |
- run: restyle-gha --help | |
test-actions-setup: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./actions/setup | |
- run: restyle --help | |
- run: restyle-gha --help | |
test-actions-run: | |
if: ${{ github.event_name == 'pull_request' }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
name: linux-binaries | |
- run: | | |
tar xzf linux-binaries/restyler-*.tar.gz | |
mv -v restyler-*/restyle-gha /usr/local/bin | |
rm -rf linux-binaries | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: ./actions/run |