Here is my .gitlab-ci.yml file, inspired by @GrandFleet's answer:
image: node:latest
cache:
paths:
- node_modules/
stages:
- test
test_async:
stage: test
services:
- trufflesuite/ganache-cli
script:
- npm install truffle
- ./node_modules/truffle/build/cli.bundled.js compile
- ./node_modules/truffle/build/cli.bundled.js migrate --network gitlab
- ./node_modules/truffle/build/cli.bundled.js test --network gitlab
When I run this on Gitlab, I get this error on ./node_modules/truffle/build/cli.bundled.js migrate --network gitlab
:
$ ./node_modules/truffle/build/cli.bundled.js migrate --network gitlab
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Unknown network "gitlab". See your Truffle configuration file for available networks.
Truffle v5.4.25 (core: 5.4.25)
Node v17.2.0
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Should I set up a Gitlab network in my truffle-config.js? And if so, how?
EDIT:
Here is my truffle-config.js file:
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 7545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
},
// Configure your compilers
compilers: {
solc: {
version: "0.8.10", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200
},
}
}
}
};
truffle-config.js
look like?