Skip to content

Commit

Permalink
meta/gh: update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
polarhive committed Apr 10, 2024
1 parent 6001058 commit 87e9a95
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 38 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: benchmark
# Benchmark anna v/s other SSGs
name: Benchmark

on:
push:
branches:
- 'prof-bench.sh'
workflow_dispatch:
workflow_dispatch:

jobs:
benchmark:
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Sample workflow for building and deploying an anna site to GitHub pages
name: Build
name: Build and Deploy

on:
push:
branches: [main]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand All @@ -25,6 +23,7 @@ defaults:
jobs:
build:
runs-on: ubuntu-latest
needs: test-and-coverage
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
Expand All @@ -37,19 +36,8 @@ jobs:
with:
go-version-file: "go.mod"

- name: test anna
run: go test ./...

- name: build anna
run: go build

- name: Insert commit hash in footer
run: |
sed -i "s/COMMIT_HASH/${{ github.sha }}/g" site/layout/partials/footer.layout
- name: build site with anna
run: |
./anna
run: go run .

- name: upload /rendered
uses: actions/upload-artifact@master
Expand All @@ -64,6 +52,7 @@ jobs:
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}

steps:
- name: download /rendered
uses: actions/download-artifact@master
Expand Down
31 changes: 13 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
# Sample workflow for building and deploying an anna site to GitHub pages
name: Tests

on: [push, pull_request]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
name: Go Test and Coverage

on:
push:
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
check:
test-and-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"

- run: go test ./...
- name: Run Tests
run: go test ./...

- name: Generate Test Coverage
run: go test -cover ./...

0 comments on commit 87e9a95

Please sign in to comment.