Merge pull request #37 from Photoroom/actions-upgrade #150
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install linux deps | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install libvips-dev libjpeg-turbo8-dev | |
- name: Set up Go | |
uses: golangci/golangci-lint-action@v6 | |
- name: Install pre-commit | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
go install golang.org/x/tools/cmd/goimports@latest | |
- name: Run pre-commit | |
run: pre-commit run --all-files | |
- name: Build | |
run: cd cmd && go build -v main.go | |
- name: Test | |
env: | |
DATAROOM_API_KEY: ${{ secrets.DATAROOM_API_KEY }} | |
DATAROOM_TEST_SOURCE: ${{ secrets.DATAROOM_TEST_SOURCE }} | |
DATAROOM_API_URL: ${{ secrets.DATAROOM_API_URL }} | |
run: cd tests && go test -v . # -race once we fix the concurrent log accesses |