Skip to content

Commit

Permalink
Dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
gurinderu committed Jul 1, 2020
1 parent d8756b5 commit 9f6d656
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v6
- uses: olafurpg/setup-scala@v7
with:
java-version: ${{ matrix.java }}
- run: git fetch --tags
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v6
- uses: olafurpg/setup-scala@v7
- run: ./scalafmt --test
- run: yarn install
- run: yarn format-check
Expand All @@ -47,17 +47,20 @@ jobs:
include:
- os: macOS-latest
artifact: scalafmt-macos
env:
NATIVE_IMAGE_STATIC: false
- os: ubuntu-latest
libc: default
artifact: scalafmt-linux-glibc
env:
- NATIVE_IMAGE_STATIC: true
NATIVE_IMAGE_STATIC: true
- os: ubuntu-latest
libc: musl
artifact: scalafmt-linux-musl
env:
- NATIVE_IMAGE_STATIC: true
- NATIVE_IMAGE_MUSL: ${GITHUB_WORKSPACE}/bundle
NATIVE_IMAGE_STATIC: true
NATIVE_IMAGE_MUSL: /home/runner/work/scalafmt/scalafmt/bundle
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v7
Expand All @@ -68,11 +71,26 @@ jobs:
run: |
wget https://github.com/gradinac/musl-bundle-example/releases/download/v1.0/musl.tar.gz
tar xvf musl.tar.gz
- run: bin/build-native-image.sh
env:
CI: true
- uses: actions/upload-artifact@master
with:
name: ${{ matrix.artifact }}
path: scalafmt
dockerize:
needs: [native-image,test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --unshallow
- uses: actions/download-artifact@v1
with:
name: scalafmt-linux-musl
path: tmp/scalafmt-linux-musl
- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: scalameta/scalafmt
tag_with_ref: true
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine

COPY tmp/scalafmt-linux-musl/scalafmt /bin/scalafmt
RUN chmod +x /bin/scalafmt

ENTRYPOINT ["/bin/scalafmt"]

0 comments on commit 9f6d656

Please sign in to comment.