Remove take action after Hacktoberfest (#314) #811
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: did-dht-ci | |
# when: | |
# - a pull request is opened against main | |
# - commits are pushed to main | |
on: | |
push: | |
# used to run action manually via the UI | |
workflow_dispatch: | |
jobs: | |
vulnerability-scan: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./impl | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.23.2 | |
- name: Install Mage | |
run: go install github.com/magefile/mage | |
- name: Check Vulnerabilities | |
run: mage -v vuln | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./impl | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.23.2 | |
- name: Install Mage | |
run: go install github.com/magefile/mage | |
- name: Check if swagger is up to date | |
if: ${{ github.ref != 'refs/heads/main' }} | |
run: | | |
mage -v spec | |
if (git diff --shortstat | grep '[0-9]'); then \ | |
echo "Swagger spec is out of date. Please run mage spec"; \ | |
exit 1; | |
fi | |
- name: Build | |
run: mage build | |
- name: Start a postgres container | |
run: docker run --rm -d --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=a library/postgres && until docker exec postgres pg_isready; do sleep 1; done | |
- name: Test | |
run: TEST_DB=postgres://postgres:[email protected]:5432/postgres mage citest | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- run: go clean -modcache # https://github.com/golangci/golangci-lint-action/issues/135 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
working-directory: impl |