Merge pull request #148 from cloudcloud/dependabot/npm_and_yarn/sass-… #351
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: main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
name: 'Unit Tests' | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
- name: 'Setup Go' | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- name: 'Hack Yarn' | |
run: corepack enable && yarn set version 4.3.1 | |
- name: 'Setup Node' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: 'Build Frontend' | |
run: yarn install && yarn build | |
- name: 'Run Tests' | |
run: go test -cover -coverprofile=coverage.txt ./... | |
- name: 'Archive Results' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage | |
path: coverage.txt | |
code_coverage: | |
name: 'Coverage Report' | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- uses: fgrosse/[email protected] | |
with: | |
coverage-artifact-name: 'code-coverage' | |
coverage-file-name: 'coverage.txt' | |
build_and_artefact: | |
strategy: | |
matrix: | |
type: | |
- os: 'linux' | |
arch: 'amd64' | |
- os: 'linux' | |
arch: 'arm64' | |
- os: 'darwin' | |
arch: 'arm64' | |
- os: 'darwin' | |
arch: 'amd64' | |
name: 'Build and Artefact' | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
- name: 'Setup Go' | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.22 | |
- name: 'Hack Yarn' | |
run: corepack enable && yarn set version 4.3.1 | |
- name: 'Setup Node' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: 'Build Frontend' | |
run: yarn install && yarn build | |
- name: 'Matrix Binaries' | |
run: GOOS=${{ matrix.type.os }} GOARCH=${{ matrix.type.arch }} go build -o dist/episodical-${{ matrix.type.arch }}-${{ matrix.type.os }} ./cmd/episodical | |
- name: 'Archive Binary' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary-${{ matrix.type.arch }}-${{ matrix.type.os }} | |
path: dist/episodical-${{ matrix.type.arch }}-${{ matrix.type.os }} | |