mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
Update GitHub Action to fix broken pipeline (#1301)
* update github workflow to fix broken pipeline * switch to sbtn command, seems like no sbt -> sbtn link is provided anymore might just work like is... * nope, not the link is missing, it does not pack sbt at all does switching to sbt proper work? * update JVM to latest LTS * Revert "update JVM to latest LTS" This reverts commit 75baaa52e86f88d596d98d656824672aa4e25cdf.
This commit is contained in:
parent
d890877b19
commit
50f69784c0
18
.github/workflows/publish.yaml
vendored
18
.github/workflows/publish.yaml
vendored
|
|
@ -3,12 +3,14 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Set variables
|
- name: Set variables
|
||||||
id: prep
|
id: prep
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -16,23 +18,25 @@ jobs:
|
||||||
REPOSITORY="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" # Repository name must be lowercase in image tags
|
REPOSITORY="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" # Repository name must be lowercase in image tags
|
||||||
|
|
||||||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
|
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
|
||||||
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) # GITHUB_SHA is the merge SHA, not the head commit SHA in a PR, replace it.
|
GITHUB_SHA=$(jq -r .pull_request.head.sha < "$GITHUB_EVENT_PATH") # GITHUB_SHA is the merge SHA, not the head commit SHA in a PR, replace it.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAGS="ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:${GITHUB_SHA}"
|
TAGS="ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:${GITHUB_SHA}"
|
||||||
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
|
if [ "${GITHUB_REF}" = "refs/heads/master" ]; then
|
||||||
TAGS="$TAGS,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:latest,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:master"
|
TAGS="$TAGS,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:latest,ghcr.io/${REPOSITORY}/${DOCKER_IMAGE}:master"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ::set-output name=tags::${TAGS}
|
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Log in to GitHub Docker Registry
|
- name: Log in to GitHub Docker Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Build container image
|
|
||||||
uses: docker/build-push-action@v2
|
- name: Build and Push container image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
|
|
|
||||||
15
.github/workflows/test.yaml
vendored
15
.github/workflows/test.yaml
vendored
|
|
@ -24,29 +24,36 @@ jobs:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
steps:
|
steps:
|
||||||
- name: Cache SBT
|
- name: Cache SBT
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.ivy2/cache
|
~/.ivy2/cache
|
||||||
~/.sbt
|
~/.sbt
|
||||||
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
|
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Scala
|
- name: Setup Scala
|
||||||
uses: coursier/setup-action@v1
|
uses: coursier/setup-action@v1
|
||||||
with:
|
with:
|
||||||
jvm: adopt:11
|
jvm: adopt:11
|
||||||
apps: sbtn
|
apps: sbt
|
||||||
|
|
||||||
- name: Run migrations
|
- name: Run migrations
|
||||||
run: sbt "server/run migrate"
|
run: sbt "server/run migrate"
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
run: sbt server/packArchiveZip
|
run: sbt server/packArchiveZip
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: sbt coverage test:compile quiet:test coverageReport
|
run: sbt coverage test:compile quiet:test coverageReport
|
||||||
|
|
||||||
- name: Upload coverage
|
- name: Upload coverage
|
||||||
run: bash <(curl -s https://codecov.io/bash)
|
run: bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server.zip
|
name: server.zip
|
||||||
path: server/target/psforever-server-*.zip
|
path: server/target/psforever-server-*.zip
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue