Skip to content

Commit

Permalink
ci: use ghcr to ci env
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuro9715 committed Sep 30, 2023
1 parent c483ee4 commit e3b966c
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,42 @@ on:
branches: [ "main" ]

jobs:
# Run each jobs in container by use of shared Dockerfile
prepare-container:
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}-pr${{ github.event.pull_request.number }}
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build:
needs: prepare-container
runs-on: ubuntu-latest
container:
images: ghcr.io/${{ github.repository }}-pr${{ github.event.pull_request.number }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- run: |
git clone https://github.com/vlang/v /opt/v --depth 1
cd /opt/v
make
./v symlink
- run: make build
- run: make run args=-help
test:
needs: prepare-container
runs-on: ubuntu-latest
container:
images: ghcr.io/${{ github.repository }}-pr${{ github.event.pull_request.number }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- run: |
git clone https://github.com/vlang/v /opt/v --depth 1
cd /opt/v
make
./v symlink
- run: make test

0 comments on commit e3b966c

Please sign in to comment.